From 86f61ad423dbf3b0e45ed770628fea640b673dc8 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Thu, 6 Dec 2001 10:55:58 +0000 Subject: fixes -p ... --- urpm.pm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 1bbc2095..2581f1b5 100644 --- a/urpm.pm +++ b/urpm.pm @@ -1067,15 +1067,12 @@ sub search_packages { if ($options{use_provides}) { #- try to search through provides. - if (my $provide_v = $urpm->{params}{provides}{$v}) { - if (scalar(keys %$provide_v) == 1 && - $urpm->{params}{info}{$provide_v->[0]} && - defined $urpm->{params}{info}{$provide_v->[0]}{id}) { - #- we assume that if the there is only one package providing the resource exactly, - #- this should be the best one that is described. - $exact{$v} = $urpm->{params}{info}{$provide_v->[0]}{id}; - next; - } + if (my @l = grep { defined $_ } map { $_ && $_->{id} } map { $urpm->{params}{info}{$_} } + keys %{$urpm->{params}{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; } foreach (keys %{$urpm->{params}{provides}}) { @@ -1264,7 +1261,7 @@ sub filter_minimal_packages_to_upgrade { #- or we have to use synthesis file. my @synthesis = map { "$urpm->{statedir}/synthesis.$_->{hdlist}" } grep { ! $_->{ignore} } @{$urpm->{media} || []}; if (grep { ! -r $_ || ! -s $_ } @synthesis) { - $urpm->{log}(_("unable to find all synthesis file, using parsehdlist server")); + $urpm->{error}(_("unable to find all synthesis file, using parsehdlist server")); pipe INPUT, OUTPUT_CHILD; pipe INPUT_CHILD, OUTPUT; $pid = fork(); -- cgit v1.2.1