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 --- urpm/install.pm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'urpm') 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