summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgurpmi22
-rw-r--r--urpm.pm42
-rwxr-xr-xurpmi2
3 files changed, 25 insertions, 21 deletions
diff --git a/gurpmi2 b/gurpmi2
index 947c1c73..21a30ce3 100755
--- a/gurpmi2
+++ b/gurpmi2
@@ -79,7 +79,7 @@ my @ask_unselect = $urpm->unselected_packages($state);
@ask_unselect
? ask_continue(N(
"Some requested packages cannot be installed:\n%s\nContinue installation anyway?",
- join "\n", $urpm->translate_why_unselected($state, sort @ask_unselect)
+ $urpm->translate_why_unselected($state, @ask_unselect)
), \&do_install)
: do_install();
diff --git a/urpm.pm b/urpm.pm
index 0ad56704..7d0570ae 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -3264,25 +3264,29 @@ sub unselected_packages {
sub uniq { my %l; $l{$_} = 1 foreach @_; grep { delete $l{$_} } @_ }
sub translate_why_unselected {
- my ($urpm, $state, @l) = @_;
-
- map {
- my $rb = $state->{rejected}{$_}{backtrack};
- my @froms = keys %{$rb->{closure} || {}};
- my @unsatisfied = @{$rb->{unsatisfied} || []};
- my $s = join ", ", (
- (map { N("due to missing %s", $_) } @froms),
- (map { N("due to unsatisfied %s", $_) } uniq(map {
- #- XXX in theory we shouldn't need this, dependencies (and not ids) should
- #- already be present in @unsatisfied. But with biarch packages this is
- #- not always the case.
- /\D/ ? $_ : scalar($urpm->{depslist}[$_]->fullname);
- } @unsatisfied)),
- $rb->{promote} && !$rb->{keep} ? N("trying to promote %s", join(", ", @{$rb->{promote}})) : @{[]},
- $rb->{keep} ? N("in order to keep %s", join(", ", @{$rb->{keep}})) : @{[]},
- );
- $_ . ($s ? " ($s)" : '');
- } @l;
+ my ($urpm, $state, @fullnames) = @_;
+
+ join("\n", map { translate_why_unselected_one($urpm, $state, $_) } sort @fullnames);
+}
+
+sub translate_why_unselected_one {
+ my ($urpm, $state, $fullname) = @_;
+
+ my $rb = $state->{rejected}{$fullname}{backtrack};
+ my @froms = keys %{$rb->{closure} || {}};
+ my @unsatisfied = @{$rb->{unsatisfied} || []};
+ my $s = join ", ", (
+ (map { N("due to missing %s", $_) } @froms),
+ (map { N("due to unsatisfied %s", $_) } uniq(map {
+ #- XXX in theory we shouldn't need this, dependencies (and not ids) should
+ #- already be present in @unsatisfied. But with biarch packages this is
+ #- not always the case.
+ /\D/ ? $_ : scalar($urpm->{depslist}[$_]->fullname);
+ } @unsatisfied)),
+ $rb->{promote} && !$rb->{keep} ? N("trying to promote %s", join(", ", @{$rb->{promote}})) : (),
+ $rb->{keep} ? N("in order to keep %s", join(", ", @{$rb->{keep}})) : (),
+ );
+ $fullname . ($s ? " ($s)" : '');
}
sub removed_packages {
diff --git a/urpmi b/urpmi
index 98078b17..1dca3df5 100755
--- a/urpmi
+++ b/urpmi
@@ -499,7 +499,7 @@ that are older than the installed ones:\n%s", $list);
my @ask_unselect = $urpm->unselected_packages($state);
if (@ask_unselect) {
- my $list = join "\n", $urpm->translate_why_unselected($state, sort @ask_unselect);
+ my $list = $urpm->translate_why_unselected($state, @ask_unselect);
my $msg = N("Some requested packages cannot be installed:\n%s", $list);
if ($urpm->{options}{auto}) {
print "$msg\n";