summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-04-12 20:55:47 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-04-12 21:24:03 +0200
commitfb1aa950f8a70e05c123a48bcab369465037cb0f (patch)
treefec2c66d0c03eec9d82346db30ed0cef97274f01 /perl-install/install/pkgs.pm
parent770a49097bbc540b3546f3dab31bdaa660a59231 (diff)
downloaddrakx-fb1aa950f8a70e05c123a48bcab369465037cb0f.tar
drakx-fb1aa950f8a70e05c123a48bcab369465037cb0f.tar.gz
drakx-fb1aa950f8a70e05c123a48bcab369465037cb0f.tar.bz2
drakx-fb1aa950f8a70e05c123a48bcab369465037cb0f.tar.xz
drakx-fb1aa950f8a70e05c123a48bcab369465037cb0f.zip
fix upgrade when package's in several media
sort by ids (like in other places) when finding providing package, thus fixing upgrade when the same package is offered in several media (mga#15350)
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index fca5b6c19..04d281f35 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -126,10 +126,11 @@ sub packagesProviding {
#- search package with given name and compatible with current architecture.
#- take the best one found (most up-to-date).
+# FIXME: reuse urpmi higher level code instead!
sub packageByName {
my ($packages, $name) = @_;
- my @l = grep { $_->name eq $name } packagesProviding($packages, $name);
+ my @l = sort { $b->id <=> $a->id } grep { $_->name eq $name } packagesProviding($packages, $name);
my $best;
foreach (@l) {