summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-10-28 20:16:14 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-10-28 20:16:14 +0000
commit74a85857d12ec5ff87f98daa5d8d6d25ccba20d8 (patch)
treed5dbfa55ecb928060d1f81f6c736e0a7e2c6986e /usr.sbin/pkg_add
parent150f70ed72db26b0d485830ad5aeaeb08d806d7c (diff)
fix error code path for pkg_info -e pouet
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_info8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index a6fc79979ee..96230b3f827 100644
--- a/usr.sbin/pkg_add/pkg_info
+++ b/usr.sbin/pkg_add/pkg_info
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_info,v 1.35 2005/09/19 10:16:32 espie Exp $
+# $OpenBSD: pkg_info,v 1.36 2005/10/28 20:16:13 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -210,6 +210,7 @@ our ($opt_c, $opt_D, $opt_d, $opt_f, $opt_I, $opt_i, $opt_k, $opt_K, $opt_L,
$opt_a, $opt_M, $opt_U, $opt_A, $opt_S);
my $terse = 0;
my $exit_code = 0;
+my $error_e = 0;
my @sought_files;
sub print_info
@@ -325,6 +326,7 @@ try {
}
if (@list == 0) {
$exit_code = 1;
+ $error_e = 1;
}
push(@ARGV, @list);
$terse = 1;
@@ -372,14 +374,14 @@ if ($opt_K && !$opt_L) {
}
if (@ARGV == 0 && !$opt_a && !$opt_A) {
- Usage "Missing package name(s)" unless $terse && $opt_q;
+ Usage "Missing package name(s)" unless $terse || $opt_q;
}
if (@ARGV > 0 && ($opt_a || $opt_A)) {
Usage "Can't specify package name(s) with -a";
}
-if (@ARGV == 0) {
+if (@ARGV == 0 && !$error_e) {
@ARGV = sort(installed_packages(defined $opt_A ? 0 : 1));
}