summaryrefslogtreecommitdiffstats
path: root/perl-install/install/pkgs.pm
diff options
context:
space:
mode:
authorArnaud Patard <rtp@mageia.org>2012-04-30 07:59:04 +0000
committerArnaud Patard <rtp@mageia.org>2012-04-30 07:59:04 +0000
commit8f5a440b8705732e2dd221cab769c1d796ba4338 (patch)
treeed63636ee0304ee99ae054dad1d04fcc1bd358e0 /perl-install/install/pkgs.pm
parent411b42978a7cbbf70d47d474460ec86f5e300015 (diff)
downloaddrakx-8f5a440b8705732e2dd221cab769c1d796ba4338.tar
drakx-8f5a440b8705732e2dd221cab769c1d796ba4338.tar.gz
drakx-8f5a440b8705732e2dd221cab769c1d796ba4338.tar.bz2
drakx-8f5a440b8705732e2dd221cab769c1d796ba4338.tar.xz
drakx-8f5a440b8705732e2dd221cab769c1d796ba4338.zip
- packageByName: make sure to return the installed noarch rpm if any.
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r--perl-install/install/pkgs.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 9fd8b8f09..c4c1a7edc 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -123,7 +123,11 @@ sub packageByName {
my $best;
foreach (@l) {
if ($best && $best != $_) {
- $_->compare_pkg($best) > 0 and $best = $_;
+ if ($best->fullname eq $_->fullname) {
+ $best = $_ if $_->flag_installed;
+ } else {
+ $_->compare_pkg($best) > 0 and $best = $_;
+ }
} else {
$best = $_;
}