summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-10-16 13:50:57 +0000
committerFrancois Pons <fpons@mandriva.com>2002-10-16 13:50:57 +0000
commitb33b1f424ab140d710e512c4343dd435ce3e2917 (patch)
treeba56fec958d837e4f00686bcb5a9f84718d1232b
parentf885c2a6a671254bf74f71267c686476fac338ac (diff)
downloadurpmi-b33b1f424ab140d710e512c4343dd435ce3e2917.tar
urpmi-b33b1f424ab140d710e512c4343dd435ce3e2917.tar.gz
urpmi-b33b1f424ab140d710e512c4343dd435ce3e2917.tar.bz2
urpmi-b33b1f424ab140d710e512c4343dd435ce3e2917.tar.xz
urpmi-b33b1f424ab140d710e512c4343dd435ce3e2917.zip
fixed use_provides option given to search_packages not always taken into account.
-rw-r--r--urpm.pm23
1 files changed, 12 insertions, 11 deletions
diff --git a/urpm.pm b/urpm.pm
index 7b3a6fb2..89e3f834 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1539,19 +1539,20 @@ sub search_packages {
foreach my $v (@$names) {
my $qv = quotemeta $v;
- if ($options{use_provides}) {
- unless ($options{fuzzy}) {
- #- try to search through provides.
- if (my @l = grep { defined $_ } map { $_ && ($options{src} ? $_->arch eq 'src' : $_->is_arch_compat) ?
- $_->id : undef } map { $urpm->{depslist}[$_] }
- 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;
- next;
- }
+ unless ($options{fuzzy}) {
+ #- try to search through provides.
+ if (my @l = grep { defined $_ } map { $_ && ($options{src} ? $_->arch eq 'src' : $_->is_arch_compat) &&
+ ($options{use_provides} || $_->name eq $v) ?
+ $_->id : undef } map { $urpm->{depslist}[$_] }
+ 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;
+ next;
}
+ }
+ if ($options{use_provides}) {
foreach (keys %{$urpm->{provides}}) {
#- search through provides to find if a provide match this one.
#- but manages choices correctly (as a provides may be virtual or