summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-18 13:00:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-18 13:00:05 +0000
commitc2cb782044aef81fc7b1be14917fe8b679b31af1 (patch)
treef7bf8ba6e8007519a7ba219b6db88a8bfbc783f3
parente0f83aa8e9ac18b3412e9218a524ccc24975f985 (diff)
downloadurpmi-c2cb782044aef81fc7b1be14917fe8b679b31af1.tar
urpmi-c2cb782044aef81fc7b1be14917fe8b679b31af1.tar.gz
urpmi-c2cb782044aef81fc7b1be14917fe8b679b31af1.tar.bz2
urpmi-c2cb782044aef81fc7b1be14917fe8b679b31af1.tar.xz
urpmi-c2cb782044aef81fc7b1be14917fe8b679b31af1.zip
- urpmq:
o fix option -a : display packages of all compatible archs (#36942) this fixes another issue introduced in commit r231535 (urpmi 4.10.15, 2007-11-15), partially fixed in r231782 (2007-11-28) the commit has 2 parts: - ensure all compatible archs are kept when {all} option is used - display one pkg per line in urpmq
-rw-r--r--NEWS1
-rw-r--r--urpm/select.pm8
2 files changed, 7 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 03b525e6..d76fb2bd 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@
this often used case
- urpmq:
o add --provides
+ o fix option -a : display packages of all compatible archs (#36942)
Version 5.1 - 16 January 2008, by Pascal "Pixel" Rigaux
diff --git a/urpm/select.pm b/urpm/select.pm
index bc1ca996..a0201426 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -83,7 +83,7 @@ sub search_packages {
my @ids = split /\|/, $name2ids->{$v};
#- in case we have a substring match, we want individual selection (for urpmq --fuzzy)
- $packages->{$_} = 1 foreach $result eq 'substring' ? @ids : $name2ids->{$v};
+ $packages->{$_} = 1 foreach $result eq 'substring' || $options{all} ? @ids : $name2ids->{$v};
foreach (@ids) {
my $pkg = $urpm->{depslist}[$_] or next;
@@ -120,8 +120,12 @@ sub _search_packages {
delete $compats{0}; #- means not compatible
#- if there are pkgs matching arch, prefer them
+ if (%compats && !$options{all}) {
+ my $best_arch = min(keys %compats);
+ %compats = ($best_arch => $compats{$best_arch});
+ }
if (%compats) {
- @l = (@$noarch, @{$compats{min(keys %compats)}});
+ @l = (@$noarch, map { @$_ } values %compats);
}
#- we assume that if there is at least one package providing