diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 11:06:08 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-08-31 11:06:08 +0000 |
commit | f964bbafe8f28c2204097382a5542bce9aab79d8 (patch) | |
tree | ff0cefb3ab72328266b2b0ad39d54fe42453928b /perl-install | |
parent | 845ea73d811a50cd8998c807fce688ff1e2da599 (diff) | |
download | drakx-backup-do-not-use-f964bbafe8f28c2204097382a5542bce9aab79d8.tar drakx-backup-do-not-use-f964bbafe8f28c2204097382a5542bce9aab79d8.tar.gz drakx-backup-do-not-use-f964bbafe8f28c2204097382a5542bce9aab79d8.tar.bz2 drakx-backup-do-not-use-f964bbafe8f28c2204097382a5542bce9aab79d8.tar.xz drakx-backup-do-not-use-f964bbafe8f28c2204097382a5542bce9aab79d8.zip |
fix bad handle of the elapsed time
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_steps_gtk.pm | 23 |
1 files changed, 12 insertions, 11 deletions
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) { |