summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-10 16:34:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-10 16:34:22 +0000
commit067df312aef730f627795919e8be4f78cd21892b (patch)
tree6c1a2256b347357ec6c731db64d0382aa74aab2f
parente88bfa3c52ccbb1e37504b3cda79631d6dbe53ce (diff)
downloadurpmi-067df312aef730f627795919e8be4f78cd21892b.tar
urpmi-067df312aef730f627795919e8be4f78cd21892b.tar.gz
urpmi-067df312aef730f627795919e8be4f78cd21892b.tar.bz2
urpmi-067df312aef730f627795919e8be4f78cd21892b.tar.xz
urpmi-067df312aef730f627795919e8be4f78cd21892b.zip
- urpmi, urpme
o default to selecting all the prefered packages according to installed locales (need perl-URPM 1.81 to work)
-rw-r--r--NEWS2
-rwxr-xr-xurpmi14
2 files changed, 12 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index e8a5d767..d8e3bc67 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- urpmi, urpme
+ o default to selecting all the prefered packages according to installed
+ locales (need perl-URPM 1.81 to work)
o do not prompt questions if not waiting for user answer
(for urpmi --force or urpme --force)
diff --git a/urpmi b/urpmi
index 2b053f11..457c1e4a 100755
--- a/urpmi
+++ b/urpmi
@@ -425,10 +425,16 @@ if (@src_names) {
}
sub ask_choice {
- my ($urpm, $_db, $_state, $choices, $virtual_pkg_name) = @_;
+ my ($urpm, $_db, $_state, $choices, $virtual_pkg_name, $prefered) = @_;
- my ($prefer, $other) = urpm::select::get_preferred($urpm, $choices, $options{prefer});
- my @choices = (@$prefer, @$other);
+ my @choices;
+ if ($prefered && @$prefered) {
+ @choices = @$choices;
+ } else {
+ ($prefered, my $other) = urpm::select::get_preferred($urpm, $choices, $options{prefer});
+ @choices = (@$prefered, @$other);
+ }
+ my $prefer = @$prefered && join(',', grep { member($choices[$_-1], @$prefered) } 1 .. @choices);
my (@l) = map {
my ($name, $summary) = (scalar($_->fullname), translate($_->summary));
@@ -452,7 +458,7 @@ sub ask_choice {
print N("In order to satisfy the '%s' dependency, one of the following packages is needed:", $virtual_pkg_name), "\n";
my $i = 0;
foreach (@l) { print " " . ++$i . "- $_\n" }
- $n = message_input_(N("What is your choice? (1-%d) ", $i), range_min => 0, range => $i);
+ $n = message_input_(N("What is your choice? (1-%d) ", $i), default => $prefer, range_min => 0, range => $i);
defined($n) && $n ne "0" or exit 1; # abort.
if ($n =~ /\D/) {
my @nn = map { $choices[$_ - 1] } grep { !/\D/ } split /[, \t]+/, $n;