summaryrefslogtreecommitdiffstats
path: root/gurpmi2
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-04-06 08:00:07 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-04-06 08:00:07 +0000
commit3a2090fa4eed30c95779c017b137f58808e116f6 (patch)
treef91234342fed54da2721ecbd400f7787f07145d5 /gurpmi2
parent1143e824c66c0ccb472a3845c5d71d3b62a9d6ab (diff)
downloadurpmi-3a2090fa4eed30c95779c017b137f58808e116f6.tar
urpmi-3a2090fa4eed30c95779c017b137f58808e116f6.tar.gz
urpmi-3a2090fa4eed30c95779c017b137f58808e116f6.tar.bz2
urpmi-3a2090fa4eed30c95779c017b137f58808e116f6.tar.xz
urpmi-3a2090fa4eed30c95779c017b137f58808e116f6.zip
Guard against undefined depslist id when showing progress bar
Diffstat (limited to 'gurpmi2')
-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);