diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | urpm/install.pm | 14 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,5 @@ +- don't give a wrong package name when it is unknown in a callback (mga#15032) + Version 8.03 - 1 January 2015 - enhanced doc diff --git a/urpm/install.pm b/urpm/install.pm index 8ede436b..b0ca418d 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -301,8 +301,18 @@ sub _get_callbacks { $options->{callback_error} ||= sub { my ($urpm, undef, $id, $subtype) = @_; - my $n = $urpm->{depslist}[$id]->fullname; - $urpm->{error}("ERROR: '$subtype' failed for $n: "); + my $n; + if (defined($id)) { + $n = $urpm->{depslist}[$id]->fullname; + } else { + # We don't know which package :( + if ($trans->NElements() == 1) { + $n = $trans->Element_fullname(0); + } else { + $n = "some package of current transaction"; + } + } + $urpm->{error}("ERROR: '$subtype' failed for $n"); }; if ($options->{verbose} >= 0 && $have_pkgs) { |