diff options
author | grant <grant@pkgsrc.org> | 2004-01-30 08:34:28 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2004-01-30 08:34:28 +0000 |
commit | fb2aa67691f0601783920193379b2d4f6275c5c1 (patch) | |
tree | 10f3d14152c60ea75f60ffbe8eef77354fe7510a /mk/bulk | |
parent | 7d347a19119d4252da976af1a2a6027e0a3aa5a6 (diff) | |
download | pkgsrc-fb2aa67691f0601783920193379b2d4f6275c5c1.tar.gz |
if an unknown option is given, don't treat it as a sandbox
directory, print the usage message instead.
Diffstat (limited to 'mk/bulk')
-rwxr-xr-x | mk/bulk/mksandbox | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox index 670fdee9592..cce0168b147 100755 --- a/mk/bulk/mksandbox +++ b/mk/bulk/mksandbox @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: mksandbox,v 1.28 2004/01/26 22:32:30 grant Exp $ +# $NetBSD: mksandbox,v 1.29 2004/01/30 08:34:28 grant Exp $ # # # Copyright (c) 2002 Alistair G. Crooks. All rights reserved. @@ -47,6 +47,12 @@ sandboxMountDirs="/bin /sbin /lib /libexec /usr/X11R6 /usr/bin /usr/games /usr/i sandboxEmptyDirs="/var/run /var/log /var/spool/mqueue" sandboxEmptyFiles="/var/run/utmp /var/run/utmpx /var/log/wtmp /var/log/wtmpx /var/log/lastlog /var/log/lastlogx" +usage() +{ + echo "Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--verbose] sandbox-dir" + exit 1 +} + opsys=`uname -s` case "$opsys" in Darwin) @@ -124,14 +130,14 @@ while [ $# -gt 0 ]; do --pkgsrc=*) pkgsrc=`echo $1 | $sedprog -e 's|^--pkgsrc=||'` ;; --src=*) src=`echo $1 | $sedprog -e 's|^--src=||'` ;; --verbose) set -x ;; + -*) usage ;; *) break ;; esac shift done if [ $# -ne 1 ]; then - echo "Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--verbose] sandbox-dir" - exit 1 + usage fi if [ `$idprog -u` -ne 0 ]; then |