From 60ef83024a2b290ab1a92f103e5de52aa909a7a3 Mon Sep 17 00:00:00 2001 From: Andreas Barth Date: Sat, 9 Apr 2011 16:18:19 +0000 Subject: [PATCH] WB::QD: replace not-for-us, auto-not-for-us by packages-arch-specific, overwritten-by-arch-all, arch-not-in-arch-list wanna-build: adjust to WB::QD-changes --- bin/wanna-build | 33 +++++++-------------------------- lib/WB/QD.pm | 10 ++++------ tests/qd.pl | 10 ++++------ 3 files changed, 15 insertions(+), 38 deletions(-) diff --git a/bin/wanna-build b/bin/wanna-build index 0908b92..6e09e8e 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -2360,12 +2360,12 @@ sub parse_all_v3 { foreach my $name (keys %$srcs) { next if $name eq '_binary'; - # state = installed, out-of-date, uncompiled, not-for-us, auto-not-for-us + # state = installed, out-of-date, uncompiled, packages-arch-specific, overwritten-by-arch-all, arch-not-in-arch-list my $pkgs = $srcs->{$name}; my $pkg = $db->{$name}; unless ($pkg) { - next SRCS if $pkgs->{'status'} eq 'not-for-us'; + next SRCS if $pkgs->{'status'} eq 'packages-arch-specific'; my $logstr = sprintf("merge-v3 %s %s_%s (%s, %s):", $vars->{'time'}, $name, $pkgs->{'version'}, $vars->{'arch'}, $vars->{'suite'}); # does at least one binary exist in the database and is more recent - if so, we're probably just outdated, ignore the source package @@ -2383,14 +2383,14 @@ sub parse_all_v3 { ($pkgs->{'binnmu'} ? ";b".$pkgs->{'binnmu'} : ""). sprintf(" (%s, %s, previous: %s", $vars->{'arch'}, $vars->{'suite'}, $pkg->{'version'}//""). ($pkg->{'binary_nmu_version'} ? ";b".$pkg->{'binary_nmu_version'} : ""). - ", $pkg->{'state'}):"; + ", $pkg->{'state'}".($pkg->{'notes'} ? "/".$pkg->{'notes'} : "")."):"; 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 )) { + if (isin($pkgs->{'status'}, qw )) { my $change = 0; - my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'auto-not-for-us' => 'Auto-Not-For-Us', 'not-for-us' => 'Auto-Not-For-Us'}->{$pkgs->{'status'}}; + my $tstate = {'installed' => 'Installed', 'related' => 'Installed', 'arch-not-in-arch-list' => 'Auto-Not-For-Us', 'packages-arch-specific' => 'Auto-Not-For-Us', 'overwritten-by-arch-all' => '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,17 +2410,13 @@ sub parse_all_v3 { $change++; } } - if (isin($pkgs->{'status'}, qw )) { - my $tnotes = {'related' => 'related', 'not-for-us' => 'packages-arch-specific'}->{$pkgs->{'status'}}; + if (isin($pkgs->{'status'}, qw )) { + my $tnotes = $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) { print "$logstr set to $tstate/".($pkg->{'notes'}//"")."\n" if $verbose || $simulate; log_ta( $pkg, "--merge-v3: $tstate" ) unless $simulate; @@ -2429,21 +2425,6 @@ sub parse_all_v3 { next; } - if ($pkgs->{'status'} eq 'not-for-us') { - next if isin( $pkg->{'state'}, qw(Not-For-Us Installed Failed-Removed)); - - if (isin( $pkg->{'state'}, qw(Failed Build-Attempted Built))) { - change_state( \$pkg, "Failed-Removed" ); - log_ta( $pkg, "--merge-v3: Failed-Removed" ) unless $simulate; - update_source_info($pkg) unless $simulate; - print "$logstr (virtually) deleted from database\n" if $verbose || $simulate; - next; - } - - print "$logstr should delete (not-for-us according to P-a-s)\n" if $verbose || $simulate || 1; # not implemented yet on purpose - next; - } - # only uncompiled / out-of-date are left, so check if anything new if (!(isin($pkgs->{'status'}, qw (uncompiled out-of-date)))) { print "$logstr package in unknown state: $pkgs->{'status'}\n"; diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index 01eea54..6a1a067 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -109,7 +109,7 @@ sub readsourcebins { $srcs->{$k}->{'status'} = 'installed' if $srcs->{$k}->{'arch'} && $srcs->{$k}->{'arch'} eq 'all'; if (!$srcs->{$k}->{'for-us'} && $srcs->{$k}->{'status'} ne 'installed') { - $srcs->{$k}->{'status'} = 'auto-not-for-us'; + $srcs->{$k}->{'status'} = 'arch-not-in-arch-list'; } delete $srcs->{$k}->{'for-us'}; @@ -117,7 +117,7 @@ sub readsourcebins { #$p ||= $pas->{'%'.$k}; #$srcs->{$k}->{'status'} = 'not-for-us' if pasignore($p, $arch); if (pasignore($pas->{'%'.$k}, $arch)) { - $srcs->{$k}->{'status'} = 'not-for-us'; + $srcs->{$k}->{'status'} = 'packages-arch-specific'; next; } for my $bin (@{$srcs->{$k}->{'binary'}}) { @@ -127,11 +127,9 @@ sub readsourcebins { next SRCS; } if ($srcs->{$k}->{'pas'}) { - $srcs->{$k}->{'status'} = 'not-for-us'; - $srcs->{$k}->{'notes'} = 'packages-arch-specific'; + $srcs->{$k}->{'status'} = 'packages-arch-specific'; } else { - $srcs->{$k}->{'status'} = 'auto-not-for-us'; - $srcs->{$k}->{'notes'} = 'overwritten-by-arch-all'; + $srcs->{$k}->{'status'} = 'overwritten-by-arch-all'; } delete $srcs->{$k}->{'pas'}; } diff --git a/tests/qd.pl b/tests/qd.pl index 720f125..7007eef 100755 --- a/tests/qd.pl +++ b/tests/qd.pl @@ -210,7 +210,7 @@ is_deeply ($$srcs, { }, 'nfu' => { 'priority' => 'optional', - 'status' => 'not-for-us', + 'status' => 'packages-arch-specific', 'version' => '4.1-3', 'name' => 'nfu', 'section' => 'shell', @@ -218,7 +218,7 @@ is_deeply ($$srcs, { }, 'autonfu' => { 'priority' => 'required', - 'status' => 'auto-not-for-us', + 'status' => 'arch-not-in-arch-list', 'version' => '1.41.11-1', 'name' => 'autonfu', 'section' => 'admin', @@ -234,8 +234,7 @@ is_deeply ($$srcs, { }, 'pbuilder' => { 'priority' => 'extra', - 'status' => 'not-for-us', - 'notes' => 'packages-arch-specific', + 'status' => 'packages-arch-specific', 'version' => '0.196', 'binary' => [ 'pbuilder', @@ -258,8 +257,7 @@ is_deeply ($$srcs, { }, 'haskell-haxr' => { 'priority' => 'extra', - 'status' => 'auto-not-for-us', - 'notes' => 'arch-all', + 'status' => 'overwritten-by-arch-all', 'version' => '3000.2.1-2', 'binary' => [ 'libghc6-haxr-prof' -- 2.39.2