From b33b1f424ab140d710e512c4343dd435ce3e2917 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 16 Oct 2002 13:50:57 +0000 Subject: fixed use_provides option given to search_packages not always taken into account. --- urpm.pm | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'urpm.pm') 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 -- cgit v1.2.1