summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-07 21:22:27 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-07 21:22:27 +0000
commitd4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd (patch)
treea2b4de95bfd14bbdc92f5b4247881f36e610d2ba /urpm/select.pm
parent91edb18c71eab641779a649ab248a3eccffefd35 (diff)
downloadurpmi-d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd.tar
urpmi-d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd.tar.gz
urpmi-d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd.tar.bz2
urpmi-d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd.tar.xz
urpmi-d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd.zip
(_search_packages) fix package count when using -a and when some
packages exist in several repositories (eg: noarch packages) (mga#4322)
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm13
1 files changed, 11 insertions, 2 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index 958b4d0e..353451c6 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -111,6 +111,7 @@ sub _search_packages {
my (%exact, %exact_a, %exact_ra, %found, %foundi);
foreach my $v (@$names) {
my $qv = quotemeta $v;
+ my @found;
$qv = '(?i)' . $qv if $options{caseinsensitive};
if (!$options{fuzzy}) {
@@ -150,8 +151,16 @@ sub _search_packages {
next;
}
}
- $pack =~ /$qv/ and push @{$found{$v}}, $id;
- $pack =~ /$qv/i and push @{$foundi{$v}}, $id if !$options{caseinsensitive};
+ if ($pack =~ /$qv/) {
+ next if member($pack, @found);
+ push @found, $pack;
+ push @{$found{$v}}, $id;
+ }
+ if ($pack =~ /$qv/i) {
+ next if member($pack, @found);
+ push @found, $pack;
+ push @{$foundi{$v}}, $id if !$options{caseinsensitive};
+ }
}
}