summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-10 09:04:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-10 09:04:59 +0000
commit7ba1f0eeaab2f07bf5656ce98fc859e6e9915614 (patch)
tree19d7ae929ac561d2b82ff23c75299abab0dc83dc
parent8d966f041c59a701cf9dfdd46fe6f4240fb1edda (diff)
downloadurpmi-7ba1f0eeaab2f07bf5656ce98fc859e6e9915614.tar
urpmi-7ba1f0eeaab2f07bf5656ce98fc859e6e9915614.tar.gz
urpmi-7ba1f0eeaab2f07bf5656ce98fc859e6e9915614.tar.bz2
urpmi-7ba1f0eeaab2f07bf5656ce98fc859e6e9915614.tar.xz
urpmi-7ba1f0eeaab2f07bf5656ce98fc859e6e9915614.zip
make it more clear
-rw-r--r--urpm.pm30
1 files changed, 16 insertions, 14 deletions
diff --git a/urpm.pm b/urpm.pm
index c4b0a608..6706c9fc 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3300,23 +3300,25 @@ sub translate_why_removed {
my ($whyk) = keys %{$closure->{$from}};
my $whyv = $closure->{$from}{$whyk};
my $frompkg = $urpm->search($from, strict_fullname => 1);
- my $s;
- for ($whyk) {
- /old_requested/
- and $s .= N("in order to install %s", $frompkg ? scalar $frompkg->fullname : $from);
- /unsatisfied/ and do {
- foreach (@$whyv) {
- $s and $s .= ",\n ";
+ 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 '*') {
- $s .= N("due to unsatisfied %s", "$1 $2");
+ N("due to unsatisfied %s", "$1 $2");
} else {
- $s .= N("due to missing %s", $_);
+ N("due to missing %s", $_);
}
- }
- };
- /conflicts/ and $s .= N("due to conflicts with %s", $whyv);
- /unrequested/ and $s .= N("unrequested");
- }
+ } @$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;