summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-08 07:23:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-08 07:23:08 +0000
commit4829bccbf414394d38823305b7a0509308bcd294 (patch)
treef40ec3bbe4edcf5cf4101e6b6bfcb2f8c8d6c7a3 /urpm
parent23cc0103cf2f25b614b281e732e379893108b28a (diff)
downloadurpmi-4829bccbf414394d38823305b7a0509308bcd294.tar
urpmi-4829bccbf414394d38823305b7a0509308bcd294.tar.gz
urpmi-4829bccbf414394d38823305b7a0509308bcd294.tar.bz2
urpmi-4829bccbf414394d38823305b7a0509308bcd294.tar.xz
urpmi-4829bccbf414394d38823305b7a0509308bcd294.zip
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?)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/select.pm5
1 files changed, 3 insertions, 2 deletions
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