From 2263fff1c0a5fc0c4ab5fe6979148d3546834b91 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 6 Oct 2008 15:43:26 +0000 Subject: - urpmi, rpmdrake: o nice exit code for "bad signature" fatal error. Fixes rpmdrake continuing on bad signature (#44575) --- NEWS | 3 +++ pod/urpmi.8.pod | 4 ++++ urpm/main_loop.pm | 2 +- urpmi | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index aadaf51a..5260aa23 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- urpmi, rpmdrake: + o nice exit code for "bad signature" fatal error. Fixes rpmdrake continuing + on bad signature (#44575) - gurpmi: o do not exit in --auto mode at end of installation which prevents restarting after priority upgrade diff --git a/pod/urpmi.8.pod b/pod/urpmi.8.pod index 64204268..979a3249 100644 --- a/pod/urpmi.8.pod +++ b/pod/urpmi.8.pod @@ -492,6 +492,10 @@ Some files are missing and some transactions failed but not all. Some files are missing and all transactions failed. +=item 15 + +Bad signature + =back =head1 BUG REPORTS diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index d7fbb504..546c0828 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -143,7 +143,7 @@ foreach my $set (@{$state->{transaction} || []}) { : N("The following packages have bad signatures"); my $msg2 = N("Do you want to continue installation ?"); my $p = join "\n", @bad_signatures; - $callbacks->{bad_signature}->("$msg:\n$p\n", $msg2); + $callbacks->{bad_signature}->("$msg:\n$p\n", $msg2) or return 15; } } diff --git a/urpmi b/urpmi index 9d7bdffb..ca075083 100755 --- a/urpmi +++ b/urpmi @@ -642,10 +642,10 @@ my $exit_code = urpm::main_loop::run($urpm, $state, #- rurpmi always abort here if ($urpm->{options}{auto} || $restricted) { print "$msg\n"; - exit 1; + 0; } else { my $yesexpr = N("Yy"); - $force || message_input_("$msg$msg2" . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/ or exit 1; + $force || message_input_("$msg$msg2" . N(" (y/N) "), boolean => 1) =~ /[$yesexpr]/; } }, ask_yes_or_no => sub { -- cgit v1.2.1