From 2864a2509a9a0f102182ffb3d5295f7563611fa0 Mon Sep 17 00:00:00 2001 From: Andreas Barth Date: Sat, 9 Apr 2011 12:53:00 +0000 Subject: [PATCH] mark overwritten by arch-all-packages as auto-not-for-us (and prepare auto-not-for-us for all all- and pas-packages) --- bin/wanna-build | 15 +++++++++++---- lib/WB/QD.pm | 10 +++++++++- tests/qd.pl | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/bin/wanna-build b/bin/wanna-build index d3faced..7993d6b 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -2388,9 +2388,9 @@ sub parse_all_v3 { if (isin($pkgs->{'status'}, qw (installed related)) && $pkgs->{'version'} eq $pkg->{'version'} && ($pkgs->{'binnmu'}//0) < int($pkg->{'binary_nmu_version'}//0)) { $pkgs->{'status'} = 'out-of-date'; } - if (isin($pkgs->{'status'}, qw (installed related auto-not-for-us))) { + if (isin($pkgs->{'status'}, qw )) { my $change = 0; - my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'auto-not-for-us' => 'Auto-Not-For-Us'}->{$pkgs->{'status'}}; + my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'auto-not-for-us' => 'Auto-Not-For-Us', 'not-for-us' => 'Auto-Not-For-Us'}->{$pkgs->{'status'}}; next if isin( $pkg->{'state'}, qw) && isin( $tstate, qw); # if the package is currently current, the status is Installed, not not-for-us if ($pkg->{'state'} ne $tstate) { @@ -2410,8 +2410,15 @@ sub parse_all_v3 { $change++; } } - if (isin($pkgs->{'status'}, qw (related)) and $pkg->{'notes'} ne "related") { - $pkg->{'notes'} = "related"; + if (isin($pkgs->{'status'}, qw )) { + my $tnotes = {'related' => 'related', 'not-for-us' => 'Packages-arch-specific'}->{$pkgs->{'status'}}; + if ($pkg->{'notes'} && $pkg->{'notes'} ne $tnotes) { + $pkg->{'notes'} = $tnotes; + $change++; + } + } + if ($pkgs->{'notes'} && ($pkg->{'notes'}//"" ne $pkgs->{'notes'})) { + $pkg->{'notes'} = $pkgs->{'notes'}; $change++; } if ($change) { diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index 5f84d5e..01eea54 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -121,11 +121,19 @@ sub readsourcebins { next; } for my $bin (@{$srcs->{$k}->{'binary'}}) { + $srcs->{$k}->{'pas'} = 1 if pasignore($pas->{$bin}, $arch); next if pasignore($pas->{$bin}, $arch); next if $binary->{$bin} and $binary->{$bin}->{'arch'} eq 'all'; next SRCS; } - $srcs->{$k}->{'status'} = 'not-for-us'; + if ($srcs->{$k}->{'pas'}) { + $srcs->{$k}->{'status'} = 'not-for-us'; + $srcs->{$k}->{'notes'} = 'packages-arch-specific'; + } else { + $srcs->{$k}->{'status'} = 'auto-not-for-us'; + $srcs->{$k}->{'notes'} = 'overwritten-by-arch-all'; + } + delete $srcs->{$k}->{'pas'}; } $srcs->{'_binary'} = $binary; local($/) = "\n"; diff --git a/tests/qd.pl b/tests/qd.pl index a0fc99c..720f125 100755 --- a/tests/qd.pl +++ b/tests/qd.pl @@ -90,6 +90,20 @@ Priority: optional Section: sound Architecture: any +Package: haskell-haxr +Binary: libghc6-haxr-prof +Version: 3000.2.1-2 +Priority: extra +Section: haskell +Architecture: any + +Package: haskall-dummy +Binary: libghc6-haxr-prof +Version: 1:3 +Priority: extra +Section: haskell +Architecture: all + EOF ; @@ -138,6 +152,12 @@ Installed-Size: 112 Architecture: all Version: 3.0-3 +Package: libghc6-haxr-prof +Version: 1:3 +Priority: extra +Section: haskell +Architecture: all + EOF ; @@ -215,6 +235,7 @@ is_deeply ($$srcs, { 'pbuilder' => { 'priority' => 'extra', 'status' => 'not-for-us', + 'notes' => 'packages-arch-specific', 'version' => '0.196', 'binary' => [ 'pbuilder', @@ -235,6 +256,17 @@ is_deeply ($$srcs, { 'name' => 'lv2core', 'section' => 'sound' }, + 'haskell-haxr' => { + 'priority' => 'extra', + 'status' => 'auto-not-for-us', + 'notes' => 'arch-all', + 'version' => '3000.2.1-2', + 'binary' => [ + 'libghc6-haxr-prof' + ], + 'name' => 'haskell-haxr', + 'section' => 'haskell' + }, '_binary' => { 'e2fsprogs' => {'version' => '1.41.11-1', 'arch' => 'i386'}, 'bash' => {'version' => '4.1-3', 'arch' => 'i386'}, @@ -242,5 +274,6 @@ is_deeply ($$srcs, { 'bash-static' => {'version' => '4.1-3', 'arch' => 'i386'}, 'all' => {'version' => '4.1-3', 'arch' => 'all'}, 'pbuilder' => { 'arch' => 'all', 'version' => '0.196' }, + 'libghc6-haxr-prof' => { 'arch' => 'all', 'version' => '1:3' }, }, }, 'reading packages'); -- 2.39.2