From cb7cf0e4565d685ede4a451bb238d164b08cc85f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 1 Mar 2005 14:15:34 +0000 Subject: Make the error "The following packages contain %s" more explicitly an error. --- urpm.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/urpm.pm b/urpm.pm index 3edda0c8..a5eb784c 100644 --- a/urpm.pm +++ b/urpm.pm @@ -2160,12 +2160,12 @@ sub search_packages { my $pkg = $urpm->{depslist}[$_]; push @{$l{$pkg->name}}, $pkg; } - if (values(%l) == 0) { + if (values(%l) == 0 || values(%l) > 1 && !$options{all}) { $urpm->{error}(N("no package named %s", $_)); - $result = 0; - } elsif (values(%l) > 1 && !$options{all}) { - $urpm->{error}(N("The following packages contain %s: %s", - $_, "\n" . join("\n", sort { $a cmp $b } keys %l))); + values(%l) != 0 and $urpm->{error}( + N("The following packages contain %s: %s", + $_, "\n" . join("\n", sort { $a cmp $b } keys %l)) + ); $result = 0; } else { foreach (values %l) { -- cgit v1.2.1