diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-06-18 20:05:44 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2013-10-03 23:17:06 +0200 |
commit | ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0 (patch) | |
tree | f29e70be95351beb64bc54d2eee3ff30b620259f | |
parent | 1756bd8b8bc477a5791cbe8c5ddf19176ed8adf5 (diff) | |
download | perl-URPM-ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0.tar perl-URPM-ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0.tar.gz perl-URPM-ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0.tar.bz2 perl-URPM-ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0.tar.xz perl-URPM-ec6cb173cc28f500e01f5acf8c8eb3e88c7adff0.zip |
adapt to perl-5.18 random hash keys ordering
thus fixing urpmi testsuite...
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | URPM/Resolve.pm | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,7 @@ +- adapt to perl-5.18 random hash keys ordering + now find_required_package() always sort matching packages by their names + before sorting them by arch and score + Version 4.27 - 22 March 2013 - fix selecting right DKMS flavor (mga#9172) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 896fe50..4ad9e7c 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -81,7 +81,7 @@ sub find_candidate_packages { push @packages, $pkg; } elsif (my $name = property2name($_)) { my $property = $_; - foreach (keys %{$urpm->{provides}{$name} || {}}) { + foreach (sort keys %{$urpm->{provides}{$name} || {}}) { my $pkg = $urpm->{depslist}[$_]; $pkg->flag_skip and next; $pkg->is_arch_compat or next; @@ -231,7 +231,7 @@ sub find_required_package { } } } - my @packages = values %packages; + my @packages = sort { $a->fullname cmp $b->fullname } values %packages; if (@packages > 1) { #- packages should be preferred if one of their provides is referenced @@ -266,7 +266,8 @@ sub _find_required_package__sort { my ($best, @other) = sort { $a->[1] <=> $b->[1] #- we want the lowest (ie preferred arch) - || $b->[2] <=> $a->[2]; #- and the higher score + || $b->[2] <=> $a->[2] #- and the higher score + || $a->[0]->fullname cmp $b->[0]->fullname; #- then by name } map { my $score = 0; $score += 2 if $_->flag_requested; |