diff options
-rwxr-xr-x | gurpmi2 | 2 | ||||
-rw-r--r-- | urpm.pm | 61 | ||||
-rw-r--r-- | urpme | 2 | ||||
-rwxr-xr-x | urpmi | 2 |
4 files changed, 35 insertions, 32 deletions
@@ -190,7 +190,7 @@ sub do_install { @ask_remove ? ask_continue(N( "The following packages have to be removed for others to be upgraded:\n%s\nContinue installation anyway?", - join "\n", $urpm->translate_why_removed($state, sort @ask_remove) + $urpm->translate_why_removed($state, @ask_remove) ), \&do_install_2) : goto &do_install_2; } @@ -3293,35 +3293,38 @@ sub removed_packages { } sub translate_why_removed { - my ($urpm, $state, @l) = @_; - map { - my $closure = $state->{rejected}{$_}{closure}; - my ($from) = keys %$closure; - my ($whyk) = keys %{$closure->{$from}}; - my $whyv = $closure->{$from}{$whyk}; - my $frompkg = $urpm->search($from, strict_fullname => 1); - my $s = do { - if ($whyk =~ /old_requested/) { - N("in order to install %s", $frompkg ? scalar $frompkg->fullname : $from); - } elsif ($whyk =~ /unsatisfied/) { - join(",\n ", map { - if (/([^\[\s]*)(?:\[\*\])?(?:\[|\s+)([^\]]*)\]?$/ && $2 ne '*') { - N("due to unsatisfied %s", "$1 $2"); - } else { - N("due to missing %s", $_); - } - } @$whyv); - } elsif ($whyk =~ /conflicts/) { - N("due to conflicts with %s", $whyv); - } elsif ($whyk =~ /unrequested/) { - N("unrequested"); - } else { - undef; - } - }; - #- now insert the reason if available. - $_ . ($s ? "\n ($s)" : ''); - } @l; + my ($urpm, $state, @fullnames) = @_; + join("\n", map { translate_why_removed_one($urpm, $state, $_) } sort @fullnames); +} +sub translate_why_removed_one { + my ($urpm, $state, $fullname) = @_; + + my $closure = $state->{rejected}{$fullname}{closure}; + my ($from) = keys %$closure; + my ($whyk) = keys %{$closure->{$from}}; + my $whyv = $closure->{$from}{$whyk}; + my $frompkg = $urpm->search($from, strict_fullname => 1); + my $s = do { + if ($whyk =~ /old_requested/) { + N("in order to install %s", $frompkg ? scalar $frompkg->fullname : $from); + } elsif ($whyk =~ /unsatisfied/) { + join(",\n ", map { + if (/([^\[\s]*)(?:\[\*\])?(?:\[|\s+)([^\]]*)\]?$/ && $2 ne '*') { + N("due to unsatisfied %s", "$1 $2"); + } else { + N("due to missing %s", $_); + } + } @$whyv); + } elsif ($whyk =~ /conflicts/) { + N("due to conflicts with %s", $whyv); + } elsif ($whyk =~ /unrequested/) { + N("unrequested"); + } else { + undef; + } + }; + #- now insert the reason if available. + $fullname . ($s ? "\n ($s)" : ''); } sub check_sources_signatures { @@ -112,7 +112,7 @@ my @toremove = $urpm->find_packages_to_remove( root => $root, ) or $urpm->{fatal}(0, N("Nothing to remove")); -my $list = join "\n", $urpm->translate_why_removed($state, sort @toremove); +my $list = $urpm->translate_why_removed($state, @toremove); if ($test && $auto) { #- Warning : the following message is parsed in urpm::parallel_* my $msg = N("Checking to remove the following packages"); @@ -527,7 +527,7 @@ if (@ask_remove) { @_ and $no_remove = 1; }); } - my $list = join "\n", $urpm->translate_why_removed($state, sort @ask_remove); + my $list = $urpm->translate_why_removed($state, @ask_remove); if ($no_remove && !$force) { print N("The installation cannot continue because the following packages |