From d95f2d4240851529416ab1e2144f8068527d87b8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 9 May 2007 16:24:59 +0000 Subject: - urpmi o display "removing package ..." when removing an obsolete or conflicting package (need perl-URPM 1.63), and not before o in verbose mode, display "removing upgraded package ..." (should make it more understandable by users) --- NEWS | 5 +++++ t/superuser--obsolete-and-conflict.t | 5 +++-- urpm/install.pm | 10 +++++++++- urpmi | 1 - 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4a68fb22..8ffbbd96 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +- urpmi + o display "removing package ..." when removing an obsolete or conflicting + package (need perl-URPM 1.63), and not before + o in verbose mode, display "removing upgraded package ..." + (should make it more understandable by users) - urpmi.addmedia o [bugfix] fix removable://... (#30257) o [bugfix] look for media/$media_dir/media_info/pubkey instead of diff --git a/t/superuser--obsolete-and-conflict.t b/t/superuser--obsolete-and-conflict.t index 09e04f90..1494cd9a 100644 --- a/t/superuser--obsolete-and-conflict.t +++ b/t/superuser--obsolete-and-conflict.t @@ -11,6 +11,7 @@ use lib '.', 't'; use helper; use Expect; use urpm::util; +use urpm::cfg; use Test::More 'no_plan'; need_root_and_prepare(); @@ -21,10 +22,10 @@ urpmi_addmedia("$name $::pwd/media/$name"); urpmi('a'); check_installed_names('a'); -test_urpmi("b c", <<'EOF'); +test_urpmi("b c", sprintf(<<'EOF', urpm::cfg::get_arch())); 1/2: c 2/2: b -removing package a +removing package a-1-1.%s EOF check_installed_names('b', 'c'); diff --git a/urpm/install.pm b/urpm/install.pm index 9630f444..9bf6c448 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -168,7 +168,15 @@ sub install { $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; + my ($name, $fullname) = ($trans->Element_name($index), $trans->Element_fullname($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"); + } else { + print N("removing package %s", $fullname), "\n" if $::verbose >= 0; + } $index++; } }; diff --git a/urpmi b/urpmi index e80753be..c8b8816d 100755 --- a/urpmi +++ b/urpmi @@ -728,7 +728,6 @@ foreach my $set (@{$state->{transaction} || []}) { } } my $to_remove = $urpm->{options}{'allow-force'} ? [] : $set->{remove} || []; - @$to_remove and print N("removing %s", "@$to_remove"), "\n"; bug_log(scalar localtime(), " ", join(' ', values %transaction_sources_install, values %transaction_sources), "\n"); $urpm->{log}("starting installing packages"); my %install_options_common = ( -- cgit v1.2.1