From 168abd684ef5981617b76e1248e00d5bc9e1ded2 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Thu, 30 Jul 2009 00:23:30 +0200 Subject: [PATCH] Store edos-output in $pkg->{'BD-Reason'} Just $pkg->{'Reason'} is a bit too generic, when we want that field to be persistent across state changes. This patch also introduduces a line to remove obsolete db fields, and uses it to remove 'Reason'. --- bin/wanna-build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/wanna-build b/bin/wanna-build index 3dd7e79..9ae5514 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -1256,6 +1256,11 @@ sub parse_sources { $pkg->{'Build-Conflicts'} = $buildconf, $change++ if ($pkg->{'Build-Conflicts'} ne $buildconf); + # Remove field from previous wanna-build versions + delete $pkg->{$_}, $change++ + if (exists $pkg->{$_}) + for (qw/Reason/); + $db{$name} = $pkg if $change; } } @@ -1869,7 +1874,7 @@ sub list_packages { if $pkg->{'State'} =~ /^Failed/; print " Dependencies: $pkg->{'Depends'}\n" if $pkg->{'State'} eq "Dep-Wait"; - print " Reason: $pkg->{'Reason'}\n" + print " Reason: $pkg->{'BD-Problem'}\n" if $pkg->{'State'} eq "BD-Uninstallable"; print " Previous state was $pkg->{'Previous-State'} until ", "$pkg->{'State-Change'}\n" @@ -2260,7 +2265,7 @@ sub change_state { delete $pkg->{'Failed-Category'}; } if (defined($$state) and $$state eq 'BD-Uninstallable') { - delete $pkg->{'Reason'}; + delete $pkg->{'BD-Problem'}; } $$state = $newstate; } @@ -2632,7 +2637,7 @@ sub call_edos_depcheck { if ($change) { if (defined $interesting_packages{$key}) { change_state( \$pkg, 'BD-Uninstallable' ); - $pkg->{'Reason'} = $interesting_packages{$key}; + $pkg->{'BD-Problem'} = $interesting_packages{$key}; } else { change_state( \$pkg, 'Needs-Build' ); } -- 2.39.5