summaryrefslogtreecommitdiffstats
path: root/urpm/install.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-27 12:40:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-27 12:40:10 +0000
commitaa93debcbe92f1306411bf85a4ff350feb4d5eba (patch)
tree52ea419c5ff0a83ca1d47a0ec15159b3a4405ae5 /urpm/install.pm
parent4df7583caa71a35d6d68c373fc0c62d1be6d955b (diff)
downloadurpmi-aa93debcbe92f1306411bf85a4ff350feb4d5eba.tar
urpmi-aa93debcbe92f1306411bf85a4ff350feb4d5eba.tar.gz
urpmi-aa93debcbe92f1306411bf85a4ff350feb4d5eba.tar.bz2
urpmi-aa93debcbe92f1306411bf85a4ff350feb4d5eba.tar.xz
urpmi-aa93debcbe92f1306411bf85a4ff350feb4d5eba.zip
- display "removing package ..." when removing, not before.
- display "removing package ..." when upgrading package (may be too verbose though)
Diffstat (limited to 'urpm/install.pm')
-rw-r--r--urpm/install.pm15
1 files changed, 10 insertions, 5 deletions
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;