diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-04-06 08:00:07 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-04-06 08:00:07 +0000 |
commit | 3a2090fa4eed30c95779c017b137f58808e116f6 (patch) | |
tree | f91234342fed54da2721ecbd400f7787f07145d5 | |
parent | 1143e824c66c0ccb472a3845c5d71d3b62a9d6ab (diff) | |
download | urpmi-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
-rwxr-xr-x | gurpmi2 | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |