From 4829bccbf414394d38823305b7a0509308bcd294 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 8 Jun 2007 07:23:08 +0000 Subject: fix previous "prefer best architecture over exact name" commit: noarch pkgs need to be taken into account differently (nb: is it a pb that the list order is not kept?) --- urpm/select.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'urpm') diff --git a/urpm/select.pm b/urpm/select.pm index 16aa2e87..24b844f8 100644 --- a/urpm/select.pm +++ b/urpm/select.pm @@ -52,13 +52,14 @@ sub search_packages { } $urpm->packages_providing($v)) { #- find the lowest value of is_arch_compat + my ($noarch, $arch) = partition { $_->arch eq 'noarch' } @l; my %compats; - push @{$compats{$_->is_arch_compat}}, $_ foreach @l; + push @{$compats{$_->is_arch_compat}}, $_ foreach @$arch; delete $compats{0}; #- means not compatible #- if there are pkgs matching arch, prefer them if (%compats) { - @l = @{$compats{min(keys %compats)}}; + @l = (@$noarch, @{$compats{min(keys %compats)}}); } #- we assume that if there is at least one package providing -- cgit v1.2.1