summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.com>2015-02-05 22:45:58 +0000
committerPascal Terjan <pterjan@gmail.com>2015-02-05 22:45:58 +0000
commit521de2161bd4dad784d8a9b4add9ad6e83e269ba (patch)
tree602307ac4ced58023c0a370b1ef229c6fb7aad4e
parent99306b0daa08067e178e2e6a3d7dc7f1b3b4e1d9 (diff)
downloadurpmi-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)
-rw-r--r--NEWS2
-rw-r--r--urpm/install.pm14
2 files changed, 14 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 62f82d49..a3443f7f 100644
--- a/NEWS
+++ b/NEWS
@@ -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) {