diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-09-09 15:25:59 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-09-09 15:25:59 +0000 |
commit | a2e8d54bd54b401ba128879e61bce32c8d626575 (patch) | |
tree | 01cd2bbde6522391ac83dec86a6039606e09b9ce /perl-install/install_any.pm | |
parent | d971a36fcbff51756456391120d472efd82160d9 (diff) | |
download | drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.gz drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.bz2 drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.tar.xz drakx-a2e8d54bd54b401ba128879e61bce32c8d626575.zip |
have a progress bar when removing packages
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 13 |
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 |