From d4037a344b6afb35fa47c1ca4593a7c0cb8cd9dd Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 7 Feb 2012 21:22:27 +0000 Subject: (_search_packages) fix package count when using -a and when some packages exist in several repositories (eg: noarch packages) (mga#4322) --- urpm/select.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'urpm/select.pm') 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}; + } } } -- cgit v1.2.1