summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-06-26 12:53:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-06-26 12:53:05 +0000
commit9b057646f7da47ceccfb46ef6b357972f60c4b1e (patch)
treea92038ac2f75a6e2f8fadd77fc68f668933c0143 /urpm/select.pm
parentd9fd3c612ce2beee21b860a46753fd5a22c318f2 (diff)
downloadurpmi-9b057646f7da47ceccfb46ef6b357972f60c4b1e.tar
urpmi-9b057646f7da47ceccfb46ef6b357972f60c4b1e.tar.gz
urpmi-9b057646f7da47ceccfb46ef6b357972f60c4b1e.tar.bz2
urpmi-9b057646f7da47ceccfb46ef6b357972f60c4b1e.tar.xz
urpmi-9b057646f7da47ceccfb46ef6b357972f60c4b1e.zip
- urpmi
o display a message "Package foo is already installed" when asking "urpmi foo bar" and only installing bar (#41593) (requires perl-URPM 3.16)
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index cf176b52..f04d3bff 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -514,6 +514,22 @@ sub unselected_packages {
grep { $state->{rejected}{$_}{backtrack} } keys %{$state->{rejected} || {}};
}
+#- misc functions to help finding ask_unselect and ask_remove elements with their reasons translated.
+sub already_installed {
+ my ($state) = @_;
+ grep { $state->{rejected}{$_}{installed} } keys %{$state->{rejected} || {}};
+}
+
+sub translate_already_installed {
+ my ($state) = @_;
+
+ my @l = already_installed($state) or return;
+
+ @l == 1 ?
+ N("Package %s is already installed", join(', ', @l)) :
+ N("Packages %s are already installed", join(', ', @l));
+}
+
sub translate_why_unselected {
my ($urpm, $state, @fullnames) = @_;
@@ -539,6 +555,7 @@ sub translate_why_unselected_one {
} @unsatisfied)),
$rb->{promote} && !$rb->{keep} ? N("trying to promote %s", join(", ", @{$rb->{promote}})) : (),
$rb->{keep} ? N("in order to keep %s", join(", ", @{$rb->{keep}})) : (),
+ $rb->{installed} ? "already installed" : (),
);
$fullname . ($s ? " ($s)" : '');
}