summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgurpmi27
1 files changed, 5 insertions, 2 deletions
diff --git a/gurpmi2 b/gurpmi2
index bf15337e..b7c0bd57 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -266,12 +266,15 @@ sub do_install_3 () {
my $total_nb = scalar grep { m|^/| } values %transaction_sources_install, values %transaction_sources;
my $callback_inst = sub {
my ($urpm, $type, $id, $subtype, $amount, $total) = @_;
- my $pkg = defined $id && $urpm->{depslist}[$id];
+ my $pkg = defined $id ? $urpm->{depslist}[$id] : undef;
if ($subtype eq 'start') {
if ($type eq 'trans') {
$progress_label->set_label(N("Preparing..."));
} else {
- $progress_label->set_label(N("Installing package `%s' (%s/%s)...", $pkg->name, ++$progress_nb, $urpm->{nb_install}));
+ defined $pkg
+ and $progress_label->set_label(
+ N("Installing package `%s' (%s/%s)...", $pkg->name, ++$progress_nb, $urpm->{nb_install})
+ );
}
} elsif ($subtype eq 'progress') {
$progressbar->set_fraction($amount / $total);