summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--urpm.pm2
-rw-r--r--urpm/install.pm15
3 files changed, 14 insertions, 6 deletions
diff --git a/NEWS b/NEWS
index b33bcea9..2c581a9b 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@
o fix displaying README.*urpmi when using --root or --urpmi-root
o fix displaying README.install.urpmi when installing a package conflicting
with an available package
+ o display "removing package ..." when removing, not before.
+ o display "removing package ..." when upgrading package
+ (may be too verbose though)
- for rpmdrake
o make translate_why_removed() safe to call (cf bug #28613)
diff --git a/urpm.pm b/urpm.pm
index b1d2ed3e..c4e602d3 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -12,7 +12,7 @@ use urpm::sys;
use urpm::cfg;
use urpm::md5sum;
-our $VERSION = '4.9.21';
+our $VERSION = '4.9.22';
our @ISA = qw(URPM Exporter);
our @EXPORT_OK = 'file_from_local_url';
diff --git a/urpm/install.pm b/urpm/install.pm
index 82f01b0c..9630f444 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -117,11 +117,7 @@ sub install {
my @produced_deltas;
foreach (@$remove) {
- if ($trans->remove($_)) {
- $urpm->{log}(N("removing package %s", $_));
- } else {
- $urpm->{error}(N("unable to remove package %s", $_));
- }
+ $trans->remove($_) or $urpm->{error}("unable to remove package " . $_);
}
foreach my $mode ($install, $upgrade) {
foreach (keys %$mode) {
@@ -150,11 +146,13 @@ sub install {
} elsif (!$options{noorder} && (@l = $trans->order)) {
} else {
my %readmes;
+ my $index;
my $fh;
#- assume default value for some parameter.
$options{delta} ||= 1000;
$options{callback_open} ||= sub {
my ($_data, $_type, $id) = @_;
+ $index++;
$fh = urpm::sys::open_safe($urpm, '<', $install->{$id} || $upgrade->{$id});
$fh ? fileno $fh : undef;
};
@@ -167,6 +165,13 @@ sub install {
foreach ($pkg->files) { /\bREADME(\.$trtype)?\.urpmi$/ and $readmes{$_} = $fullname }
close $fh if defined $fh;
};
+ $options{callback_uninst} = sub {
+ my ($_urpm, undef, undef, $subtype) = @_;
+ if ($subtype eq 'start') {
+ print N("removing package %s", $trans->Element_name($index)), "\n" if $::verbose >= 0;
+ $index++;
+ }
+ };
if ($::verbose >= 0 && (scalar keys %$install || scalar keys %$upgrade)) {
$options{callback_inst} ||= \&install_logger;
$options{callback_trans} ||= \&install_logger;