summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-07-21 11:11:42 +0000
committerFrancois Pons <fpons@mandriva.com>2003-07-21 11:11:42 +0000
commit0f5b9b335cfa33d811324afedad8ddb08020f37d (patch)
tree4070e19a9f0bb6aa92a2d6020c3f760a45c5eafa /urpm.pm
parent4b7e96a97bfce1251ccac8f2f43f1b85c11ecdb0 (diff)
downloadurpmi-0f5b9b335cfa33d811324afedad8ddb08020f37d.tar
urpmi-0f5b9b335cfa33d811324afedad8ddb08020f37d.tar.gz
urpmi-0f5b9b335cfa33d811324afedad8ddb08020f37d.tar.bz2
urpmi-0f5b9b335cfa33d811324afedad8ddb08020f37d.tar.xz
urpmi-0f5b9b335cfa33d811324afedad8ddb08020f37d.zip
avoid proposing all provides if a package has the same name as the property
searched when calling URPM::search_packages.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 3aca28ee..74eee1f2 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2119,7 +2119,12 @@ sub search_packages {
keys %{$urpm->{provides}{$v} || {}}) {
#- we assume that if the there is at least one package providing the resource exactly,
#- this should be the best ones that is described.
- $exact{$v} = join '|', @l;
+ #- but we first check if one of the packages has the same name as searched.
+ if (my @l2 = grep { $_->name eq $v} @l) {
+ $exact{$v} = join '|', @l2;
+ } else {
+ $exact{$v} = join '|', @l;
+ }
next;
}
}