summaryrefslogtreecommitdiff
path: root/mk/bulk/mksandbox
diff options
context:
space:
mode:
authorgrant <grant@pkgsrc.org>2004-01-30 08:51:29 +0000
committergrant <grant@pkgsrc.org>2004-01-30 08:51:29 +0000
commita7f025fe763dcd817b74c73aff8d35b59123a5ba (patch)
tree02d5bdfe648d93ab1ea3c115cbec7fe3f2c3a5a2 /mk/bulk/mksandbox
parent96104482fe1beb6f29d547f35354d0e43029bd9f (diff)
downloadpkgsrc-a7f025fe763dcd817b74c73aff8d35b59123a5ba.tar.gz
print a useful error if the pkgsrc directory or src directory
doesn't exist.
Diffstat (limited to 'mk/bulk/mksandbox')
-rwxr-xr-xmk/bulk/mksandbox19
1 files changed, 16 insertions, 3 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox
index cce0168b147..cd55019048a 100755
--- a/mk/bulk/mksandbox
+++ b/mk/bulk/mksandbox
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: mksandbox,v 1.29 2004/01/30 08:34:28 grant Exp $
+# $NetBSD: mksandbox,v 1.30 2004/01/30 08:51:29 grant Exp $
#
#
# Copyright (c) 2002 Alistair G. Crooks. All rights reserved.
@@ -53,6 +53,12 @@ usage()
exit 1
}
+err()
+{
+ echo "error: $1"
+ exit 1
+}
+
opsys=`uname -s`
case "$opsys" in
Darwin)
@@ -141,8 +147,15 @@ if [ $# -ne 1 ]; then
fi
if [ `$idprog -u` -ne 0 ]; then
- echo "You must be root to run this script"
- exit 1
+ err "You must be root to run this script."
+fi
+
+if [ ! -d $pkgsrc ]; then
+ err "pkgsrc directory $pkgsrc does not exist."
+fi
+
+if [ ! -d $src ]; then
+ err "source directory $src does not exist."
fi
sandbox=$1