X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lib%2FWB%2FQD.pm;h=5f84d5ebe065b12a7b6cb6ac65e2afa82b16d6b1;hb=6acac7413048ee7a0c90c3a3989f42554a60b10a;hp=4c2806fe0cbae72d7d079ea6c16e49488194838f;hpb=04f27ccc2952e6bebc3ebbf20409ca1af3b6e958;p=wannabuild.git diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index 4c2806f..5f84d5e 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -2,7 +2,12 @@ package WB::QD; use strict; use IO::Uncompress::AnyInflate qw(anyinflate); -use Dpkg::Version qw(vercmp); +use Dpkg::Version (); # import nothing +if ( defined $Dpkg::Version::VERSION ) { + *vercmp = \&Dpkg::Version::version_compare; +} else { + *vercmp = \&Dpkg::Version::vercmp; +} use Dpkg::Arch qw(debarch_is); use Data::Dumper; @@ -72,6 +77,8 @@ sub readsourcebins { /^Source:\s*(\S+)$/mi and $p->{'source'} = $1; /^Source:\s*(\S+)\s+\((\S+)\)$/mi and $p->{'source'} = $1 and $p->{'version'} = $2; + # consider packages as non-existant if it's all but outdated + next if $p->{'arch'} eq 'all' && $srcs->{$p->{'source'}} && $srcs->{$p->{'source'}}->{'version'} && vercmp($srcs->{$p->{'source'}}->{'version'}, $p->{'version'}) > 0; next unless $p->{'arch'} eq 'all' || $p->{'arch'} eq ${arch}; $binary->{$p->{'binary'}} = { 'version' => $p->{'version'}, 'arch' => $p->{'arch'}} unless $binary->{$p->{'binary'}} and vercmp($binary->{$p->{'binary'}}->{'version'}, $p->{'version'}) < 0;