aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-06-14 00:11:50 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-06-14 00:25:14 +0200
commit73526916f93a2c54a9a9b772ef9c269b29adcdd5 (patch)
tree99859701ac92dd5c0f705627df7c729cd95ebbb5
parent622f0f0b118d9a5b94f01a07f40191e7888b2c4a (diff)
downloadperl-URPM-73526916f93a2c54a9a9b772ef9c269b29adcdd5.tar
perl-URPM-73526916f93a2c54a9a9b772ef9c269b29adcdd5.tar.gz
perl-URPM-73526916f93a2c54a9a9b772ef9c269b29adcdd5.tar.bz2
perl-URPM-73526916f93a2c54a9a9b772ef9c269b29adcdd5.tar.xz
perl-URPM-73526916f93a2c54a9a9b772ef9c269b29adcdd5.zip
fix finding better pkg (mga#23037)
alter commit ef5c24cccff5f374232276b3064813aba88ee888 so that sorting pkgs got a better one in first place, by: - comparing EVRs before name - comparing EVRs rather than synthesis ids (cherry picked from commit 3ab0f02ec1b5bc55fd320df7982622387f3a42c2)
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm3
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index b4292d9..1a595b1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix finding better pkg (mga#23037)
+
Version 5.12 - 10 November 2016
- fix more compilation warnings
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 8020981..0a51bec 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -337,6 +337,7 @@ 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->[0]->compare_pkg($a->[0]) #- then by EVR (for upgrade)
|| $a->[0]->fullname cmp $b->[0]->fullname; #- then by name
} map {
my $score = 0;
@@ -360,7 +361,7 @@ sub _find_required_package__sort {
if ($urpm->{media}) {
@chosen_with_score = sort {
$a->[2] != $b->[2] ?
- $a->[0]->id <=> $b->[0]->id :
+ $b->[0]->compare_pkg($a->[0]) :
$b->[1] <=> $a->[1] || $b->[0]->compare_pkg($a->[0]);
} map { [ $_, _score_for_locales($urpm, $db, $_), pkg2media($urpm->{media}, $_) ] } @chosen;
} else {