diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-06-29 22:54:32 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-06-29 22:54:32 +0000 |
commit | f8a129b15f2a594b09d22122d1524f8585d954a9 (patch) | |
tree | ee3be4660609e4ea2dbcba545e0a4078468bbba6 /usr.sbin/pkg_add | |
parent | af3b956259bd202a8e4d749e0ef04969cbd580e9 (diff) |
stop if no pkgname.
from deraadt@.
also lock_db later, since we can.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index f0eb3b3f0fe..c8a5175ed55 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.174 2005/06/26 11:25:11 espie Exp $ +# $OpenBSD: pkg_add,v 1.175 2005/06/29 22:54:31 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -780,7 +780,9 @@ $state->{very_verbose} = $opt_v >= 2; $state->{verbose} = $opt_v; $state->{beverbose} = $opt_n || ($opt_v >= 2); -lock_db($opt_n); +if (@ARGV == 0) { + Usage "Missing pkgname"; +} if (!$opt_x && !$state->{beverbose}) { OpenBSD::ProgressMeter::enable(); } @@ -793,6 +795,7 @@ if ($< && !$forced{nonroot}) { } } +lock_db($opt_n); my @todo = (@ARGV); if (defined $state->{forced}->{kitchensink}) { reorder(\@todo); |