diff options
-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; |