summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-01 14:15:34 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-03-01 14:15:34 +0000
commitcb7cf0e4565d685ede4a451bb238d164b08cc85f (patch)
tree7ac3af23559e5f0c2426a7e319e399509d756ced
parent5e57870e9dbe0dcf803e421439ea4101822dd975 (diff)
downloadurpmi-cb7cf0e4565d685ede4a451bb238d164b08cc85f.tar
urpmi-cb7cf0e4565d685ede4a451bb238d164b08cc85f.tar.gz
urpmi-cb7cf0e4565d685ede4a451bb238d164b08cc85f.tar.bz2
urpmi-cb7cf0e4565d685ede4a451bb238d164b08cc85f.tar.xz
urpmi-cb7cf0e4565d685ede4a451bb238d164b08cc85f.zip
Make the error "The following packages contain %s" more explicitly an error.
-rw-r--r--urpm.pm10
1 files 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) {