From: Andreas Barth Date: Sat, 2 Apr 2011 12:59:46 +0000 (+0000) Subject: WB::QD: handle case when arch=all-packages becomes arch=any (plus testcase) X-Git-Url: https://git.donarmstrong.com/?p=wannabuild.git;a=commitdiff_plain;h=6acac7413048ee7a0c90c3a3989f42554a60b10a WB::QD: handle case when arch=all-packages becomes arch=any (plus testcase) --- diff --git a/bin/wanna-build b/bin/wanna-build index 7d3678a..d3faced 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -2377,6 +2377,8 @@ sub parse_all_v3 { } $pkg->{'package'} = $name; } + $pkg->{'version'} ||= ""; + $pkg->{'state'} ||= ""; my $logstr = sprintf("merge-v3 %s %s_%s", $vars->{'time'}, $name, $pkgs->{'version'}). ($pkgs->{'binnmu'} ? ";b".$pkgs->{'binnmu'} : ""). sprintf(" (%s, %s, previous: %s", $vars->{'arch'}, $vars->{'suite'}, $pkg->{'version'}//""). diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index 48ae979..5f84d5e 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -77,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; diff --git a/tests/qd.pl b/tests/qd.pl index 6ae5100..a0fc99c 100755 --- a/tests/qd.pl +++ b/tests/qd.pl @@ -83,6 +83,13 @@ Priority: required Section: admin Architecture: linux-any +Package: lv2core +Binary: lv2core +Version: 4.0-5 +Priority: optional +Section: sound +Architecture: any + EOF ; @@ -124,6 +131,13 @@ Section: devel Architecture: all Version: 0.196 +Package: lv2core +Priority: optional +Section: sound +Installed-Size: 112 +Architecture: all +Version: 3.0-3 + EOF ; @@ -211,6 +225,16 @@ is_deeply ($$srcs, { 'depends' => 'debhelper (>= 7), docbook-xsl, ldp-docbook-xsl (>= 0.0.20040321-0.1), xsltproc, dpkg-dev (>= 1.13.19), dblatex, debconf | debconf-2.0, po-debconf, po4a', 'conflicts' => 'dash' }, + 'lv2core' => { + 'priority' => 'optional', + 'status' => 'uncompiled', + 'version' => '4.0-5', + 'binary' => [ + 'lv2core' + ], + 'name' => 'lv2core', + 'section' => 'sound' + }, '_binary' => { 'e2fsprogs' => {'version' => '1.41.11-1', 'arch' => 'i386'}, 'bash' => {'version' => '4.1-3', 'arch' => 'i386'},