From 3d9a2bcd451b1e0f0ee9b6afe93d01c16c37a124 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Feb 2015 10:54:37 +0100 Subject: always display the right package name on errors fixes mga#15032 and also simplify... needs URPM >= 5.04 --- NEWS | 1 + urpm/install.pm | 15 ++------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/NEWS b/NEWS index a3443f7f..708ac91c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +- always display the right package name on errors (mga#15032) - don't give a wrong package name when it is unknown in a callback (mga#15032) Version 8.03 - 1 January 2015 diff --git a/urpm/install.pm b/urpm/install.pm index d97c4c14..0aa29528 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -300,19 +300,8 @@ sub _get_callbacks { $options->{callback_uninst} ||= $options->{verbose} >= 0 ? \&install_logger : $erase_logger; $options->{callback_error} ||= sub { - my ($urpm, undef, $id, $subtype) = @_; - 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 = "(unknown)"; - } - } - $urpm->{error}("ERROR: '$subtype' failed for $n"); + my ($urpm, undef, $id, $subtype, undef, undef, $fullname) = @_; + $urpm->{error}("ERROR: '$subtype' failed for $fullname"); }; if ($options->{verbose} >= 0 && $have_pkgs) { -- cgit v1.2.1