diff options
author | Pascal Terjan <pterjan@gmail.com> | 2015-02-05 22:45:58 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@gmail.com> | 2015-02-05 22:45:58 +0000 |
commit | 521de2161bd4dad784d8a9b4add9ad6e83e269ba (patch) | |
tree | 602307ac4ced58023c0a370b1ef229c6fb7aad4e /urpm | |
parent | 99306b0daa08067e178e2e6a3d7dc7f1b3b4e1d9 (diff) | |
download | urpmi-521de2161bd4dad784d8a9b4add9ad6e83e269ba.tar urpmi-521de2161bd4dad784d8a9b4add9ad6e83e269ba.tar.gz urpmi-521de2161bd4dad784d8a9b4add9ad6e83e269ba.tar.bz2 urpmi-521de2161bd4dad784d8a9b4add9ad6e83e269ba.tar.xz urpmi-521de2161bd4dad784d8a9b4add9ad6e83e269ba.zip |
Don't give a wrong package name when it is unknown in a callback (mga#15032)
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/install.pm | 14 |
1 files changed, 12 insertions, 2 deletions
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) { |