summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-04-14 18:00:52 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-04-14 18:12:55 +0200
commit9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea (patch)
tree517611f8c0af170e847397acb3b3b390d74d9932 /urpm
parent32c4bc874e3f7fc99188bf045902b1018f38855a (diff)
downloadurpmi-9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea.tar
urpmi-9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea.tar.gz
urpmi-9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea.tar.bz2
urpmi-9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea.tar.xz
urpmi-9632cd2bcb01a72f9389f3ef148e2e2b70a4b6ea.zip
further simplify
Diffstat (limited to 'urpm')
-rw-r--r--urpm/install.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/urpm/install.pm b/urpm/install.pm
index 7c32fa0a..a351c9d8 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -94,7 +94,7 @@ See L<URPM> for parameters
=cut
# install logger callback
-my ($erase_logger, $index, $total_pkg, $uninst_count);
+my ($erase_logger, $index, $total_pkg, $uninst_count, $current_pkg);
sub install_logger {
my ($urpm, $type, undef, $subtype, $amount, $total) = @_;
local $| = 1;
@@ -113,7 +113,7 @@ sub install_logger {
if ($type eq 'uninst') {
$total_pkg = $urpm->{trans}->NElements - $index if !$uninst_count;
$cnt = ++$uninst_count;
- $pname = N("removing %s", $urpm->{trans}->Element_fullname($index));
+ $pname = N("removing %s", $current_pkg);
$erase_logger->($urpm, undef, undef, $subtype);
} else {
$pname = $urpm->{trans}->Element_name($index);
@@ -285,14 +285,14 @@ sub _get_callbacks {
my ($urpm, undef, undef, $subtype) = @_;
if ($subtype eq 'start') {
- my ($name, $fullname) = ($trans->Element_name($index), $trans->Element_fullname($index));
+ my $name = $trans->Element_name($index);
my @previous = map { $trans->Element_name($_) } 0 .. ($index - 1);
# looking at previous packages in transaction
# we should be looking only at installed packages, but it should not give a different result
if (member($name, @previous)) {
- $urpm->{log}("removing upgraded package $fullname");
+ $urpm->{log}("removing upgraded package $current_pkg");
} else {
- $urpm->{print}(N("removing package %s", $fullname)) if $verbose >= 0;
+ $urpm->{print}(N("removing package %s", $current_pkg)) if $verbose >= 0;
}
}
};
@@ -302,6 +302,7 @@ sub _get_callbacks {
$options->{callback_elem} ||= sub {
my (undef, undef, undef, undef, $idx, undef) = @_;
$index = $idx;
+ $current_pkg = $trans->Element_fullname($idx);
};
$options->{callback_error} ||= sub {
my ($urpm, undef, $id, $subtype, undef, undef, $fullname) = @_;