summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-09-09 15:25:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-09-09 15:25:59 +0000
commita2e8d54bd54b401ba128879e61bce32c8d626575 (patch)
tree01cd2bbde6522391ac83dec86a6039606e09b9ce
parentd971a36fcbff51756456391120d472efd82160d9 (diff)
downloaddrakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar
drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.gz
drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.bz2
drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.xz
drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.zip
have a progress bar when removing packages
-rw-r--r--perl-install/install_any.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index 2df342426..22b0f7843 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -648,8 +648,19 @@ sub setPackages {
$o->{packages}{rpmdb} ||= pkgs::rpmDbOpen($o->{isUpgrade});
if (my $extension = $o->{upgrade_by_removing_pkgs_matching}) {
+ my $time = time();
$wait_message->(N("Removing packages prior to upgrade..."));
- push @{$o->{default_packages}}, pkgs::upgrade_by_removing_pkgs($o->{packages}, \&install_steps::installCallback, $extension, "$ENV{SHARE_PATH}/upgrade-map.$o->{isUpgrade}");
+ my ($current, $total);
+ my $callback = sub {
+ my (undef, $type, $_id, $subtype, $amount) = @_;
+ if ($type eq 'user') {
+ ($current, $total) = (0, $amount);
+ } elsif ($type eq 'uninst' && $subtype eq 'stop') {
+ $wait_message->('', $current++, $total);
+ }
+ };
+ push @{$o->{default_packages}}, pkgs::upgrade_by_removing_pkgs($o->{packages}, $callback, $extension, "$ENV{SHARE_PATH}/upgrade-map.$o->{isUpgrade}");
+ log::l("Removing packages took: ", formatTimeRaw(time() - $time));
}
#- always try to select basic kernel (else on upgrade, kernel will never be updated provided a kernel is already