From f964bbafe8f28c2204097382a5542bce9aab79d8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 31 Aug 2005 11:06:08 +0000 Subject: fix bad handle of the elapsed time --- perl-install/install_steps_gtk.pm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'perl-install/install_steps_gtk.pm') diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 37062369e..1c336421c 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -574,19 +574,20 @@ If you do not have it, press Cancel to avoid installation from this Cd-Rom.", $n catch_cdie { $install_result = $o->install_steps::installPackages($packages) } sub { log::l("catch_cdie: $@"); - my $time = time(); - if ($@ =~ /^error ordering package list: (.*)/) { - $o->ask_yesorno('', [ -N("There was an error ordering packages:"), $1, N("Go on anyway?") ], 1) and return 1; - ${$_[0]} = "already displayed"; - } elsif ($@ =~ /^error installing package list: (.*)/) { - $o->ask_yesorno('', [ -N("There was an error installing packages:"), $1, N("Go on anyway?") ], 1) and return 1; - ${$_[0]} = "already displayed"; + if (my @err = $@ =~ /^error ordering package list: (.*)/ ? + (N("There was an error ordering packages:"), $1) : + $@ =~ /^error installing package list: (.*)/ ? + (N("There was an error installing packages:"), $1) : @{[]}) { + my $time = time(); + if ($o->ask_yesorno('', [ @err, N("Go on anyway?") ], 1)) { + #- add the elapsed time (otherwise the predicted time will be rubbish) + $start_time += time() - $time; + return 1; + } else { + ${$_[0]} = "already displayed"; + } } $w->destroy; - #- add the elapsed time (otherwise the predicted time will be rubbish) - $start_time += time() - $time; 0; }; if ($pkgs::cancel_install) { -- cgit v1.2.1