From dffbdd1a7bcf1feb2f35624cb46e58d9bd80a324 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 7 Mar 2007 14:44:20 +0000 Subject: fix wrong count number while dowloading packages and sync messages with urpmi/gurpmi ones (#29237) --- Rpmdrake/pkg.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 01e95bb3..35798567 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -467,7 +467,6 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( $state->{selected}, clean_all => 0 ); - my $distant_number = scalar keys %$state; if (!$local_sources && (!$list || !@$list)) { interactive_msg( N("Unable to get source packages."), @@ -508,7 +507,6 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( my $_guard = before_leaving { urpm::removable::try_umounting_removables($urpm) }; Rpmdrake::gurpm::init(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::w->{real_window}); - my $distant_progress; my $canceled; my (@errors); my $something_installed; @@ -564,12 +562,20 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-( \%transaction_sources, \%error_sources, callback => sub { - my ($mode, $file, $percent) = @_; + my ($mode, $file, $percent, $total, $eta, $speed) = @_; if ($mode eq 'start') { - Rpmdrake::gurpm::label(N("Downloading package `%s' (%s/%s)...", - basename($file), ++$distant_progress, $distant_number)); + Rpmdrake::gurpm::label(N("Downloading package `%s'...", basename($file))); Rpmdrake::gurpm::validate_cancel(but(N("Cancel")), sub { $canceled = 1 }); } elsif ($mode eq 'progress') { + Rpmdrake::gurpm::label( + join("\n", + N("Downloading package `%s'...", basename($file)), + (defined $total && defined $eta ? + N(" %s%% of %s completed, ETA = %s, speed = %s", $percent, $total, $eta, $speed) + : N(" %s%% completed, speed = %s", $percent, $speed) + ) =~ /^\s*(.*)/ + ), + ); Rpmdrake::gurpm::progress($percent/100); } elsif ($mode eq 'end') { Rpmdrake::gurpm::progress(1); -- cgit v1.2.1