summaryrefslogtreecommitdiffstats
path: root/gurpm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-05-02 14:41:48 +0000
committerThierry Vignaud <tv@mageia.org>2013-05-02 14:41:48 +0000
commit730079e26af74740e2fa63255eeb83fcf31cd72b (patch)
treee99c85a54aec7716067a7069a920c6ddc3d5aa0d /gurpm
parent4bf9ff998280ea1947dd781a64809f6a335d0cf6 (diff)
downloadurpmi-730079e26af74740e2fa63255eeb83fcf31cd72b.tar
urpmi-730079e26af74740e2fa63255eeb83fcf31cd72b.tar.gz
urpmi-730079e26af74740e2fa63255eeb83fcf31cd72b.tar.bz2
urpmi-730079e26af74740e2fa63255eeb83fcf31cd72b.tar.xz
urpmi-730079e26af74740e2fa63255eeb83fcf31cd72b.zip
simplify
Diffstat (limited to 'gurpm')
-rw-r--r--gurpm/RPMProgressDialog.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/gurpm/RPMProgressDialog.pm b/gurpm/RPMProgressDialog.pm
index b059271d..ae6b4950 100644
--- a/gurpm/RPMProgressDialog.pm
+++ b/gurpm/RPMProgressDialog.pm
@@ -51,7 +51,7 @@ sub title {
my ($mainw, $urpm, $old_main_window);
my $progressbar_size = 450;
-my ($progress_nb, $download_nb, $uninst_count);
+my ($progress_nb, $download_nb, $index);
=head2 Creators
@@ -164,7 +164,7 @@ sub init_progressbar {
$progressbar->set_size_request($progressbar_size, -1);
$vbox->pack_start($progressbar, 0, 0, 0);
$w->{progressbar} = $progressbar;
- $progress_nb = $download_nb = $uninst_count = 0;
+ $progress_nb = $download_nb = $index = 0;
$w->change_widget($vbox);
}
@@ -188,8 +188,8 @@ Update the progress bar
sub set_progressbar {
my ($w, $local_ratio) = @_;
- if ($progress_nb || $download_nb || $uninst_count) { # this happens when computing transaction
- $w->{global_progressbar}->set_fraction(($download_nb + $progress_nb + $uninst_count - 1 + $local_ratio) / 2 / $urpm->{nb_install});
+ if ($progress_nb || $download_nb) { # this happens when computing transaction
+ $w->{global_progressbar}->set_fraction(($download_nb + $progress_nb - 1 + $local_ratio) / 2 / $urpm->{nb_install});
}
$w->{progressbar}->set_fraction($local_ratio);
}
@@ -305,17 +305,17 @@ sub callback_inst {
my $pkg = defined $id ? $urpm->{depslist}[$id] : undef;
if ($subtype eq 'start') {
if ($type eq 'trans') {
- $uninst_count = 0;
+ $index = 0;
$mainw->set_progresslabel(N("Preparing..."));
} else {
my $msg;
if ($type eq 'uninst') {
- $msg = N("Removing package `%s' ...", $urpm->{trans}->Element_fullname($progress_nb+$uninst_count));
- $uninst_count++;
+ $msg = N("Removing package `%s' ...", $urpm->{trans}->Element_fullname($index));
} else {
$progress_nb++;
$msg = N("Installing package `%s' (%s/%s)...", $pkg->name, $progress_nb, $urpm->{nb_install});
}
+ $index++;
$download_nb = max($download_nb, $progress_nb);
$mainw->set_progressbar(0);
$mainw->set_progresslabel($msg);