From ffb2d910aa08ff5feb4337454af10ecc03bfd0c3 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 12 Apr 2015 02:39:09 +0200 Subject: fix upgrade when package's in several media sort by ids (like in other places) when promoting (b/c of eg: conflicts), thus fixing upgrade when the same package is offered in several media (mga#15350) see commit 53e38beae4d9638f41b219521b802a2969d68909 for similar issue --- NEWS | 2 ++ URPM/Resolve.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 39a394f..87031fc 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- fix upgrade when package's in several media (mga#15350) + Version 5.05 - 26 February 2015 - fix a segfault when callbacks don't get a header diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 2f580ae..641e006 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1507,7 +1507,7 @@ sub _handle_diff_provides { } if (@packages) { - my $best = join('|', map { $_->id } @packages); + my $best = join('|', sort { $a <=> $b } map { $_->id } @packages); $urpm->{debug_URPM}("promoting " . join(' ', _ids_to_fullnames($urpm, split('\|', $best))) . " because of conflict above") if $urpm->{debug_URPM}; push @$properties, { required => $best, promote => $n, psel => $pkg }; } else { @@ -1564,7 +1564,7 @@ sub _handle_conflict { } if (@packages) { - my $best = join('|', map { $_->id } @packages); + my $best = join('|', sort { $a <=> $b } map { $_->id } @packages); $urpm->{debug_URPM}("promoting " . join('|', map { scalar $_->fullname } @packages) . " because of conflict above") if $urpm->{debug_URPM}; unshift @$properties, { required => $best, promote_conflicts => $reason }; } else { -- cgit v1.2.1