aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-03-26 11:10:11 +0000
committerThierry Vignaud <tv@mandriva.org>2007-03-26 11:10:11 +0000
commitfa8ff7e9cbca428d122cd55cb2221791ea352ca7 (patch)
treee4754a78dacb68f0c84c94bdfa6623c4b66d7957
parentae1964f83e161b508de9fd17edf0e5077cd3d415 (diff)
downloadrpmdrake-fa8ff7e9cbca428d122cd55cb2221791ea352ca7.tar
rpmdrake-fa8ff7e9cbca428d122cd55cb2221791ea352ca7.tar.gz
rpmdrake-fa8ff7e9cbca428d122cd55cb2221791ea352ca7.tar.bz2
rpmdrake-fa8ff7e9cbca428d122cd55cb2221791ea352ca7.tar.xz
rpmdrake-fa8ff7e9cbca428d122cd55cb2221791ea352ca7.zip
(perform_installation) cleanup & simplify fatal errors managment
-rwxr-xr-xRpmdrake/pkg.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 24940866..f0e5da3b 100755
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -457,11 +457,16 @@ sub perform_parallel_install {
sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
my ($urpm, $pkgs) = @_;
- my $fatal_msg;
my @error_msgs;
my %Readmes;
my $statusbar_msg_id;
- local $urpm->{fatal} = sub { printf STDERR "Fatal: %s\n", $_[1]; $fatal_msg = $_[1]; goto fatal_error };
+ local $urpm->{fatal} = sub {
+ my $fatal_msg = $_[1];
+ printf STDERR "Fatal: %s\n", $fatal_msg;
+ Rpmdrake::gurpm::end();
+ interactive_msg(N("Installation failed"),
+ N("There was a problem during the installation:\n\n%s", $fatal_msg));
+ };
local $urpm->{error} = sub { printf STDERR "Error: %s\n", $_[0]; push @error_msgs, $_[0] };
my $w = $::main_window;
@@ -786,10 +791,6 @@ you may now inspect some in order to take actions:"),
statusbar_msg_remove($statusbar_msg_id); #- XXX maybe remove this
return !($something_installed || scalar(@to_remove));
- fatal_error:
- Rpmdrake::gurpm::end();
- interactive_msg(N("Installation failed"),
- N("There was a problem during the installation:\n\n%s", $fatal_msg));
return_with_error:
Rpmdrake::gurpm::end();
return !$something_installed;