From c2cb782044aef81fc7b1be14917fe8b679b31af1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 18 Jan 2008 13:00:05 +0000 Subject: - 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 --- urpm/select.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'urpm') 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 -- cgit v1.2.1