pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/bulk print a useful error if the pkgsrc directory o...
details: https://anonhg.NetBSD.org/pkgsrc/rev/0687c4808a1e
branches: trunk
changeset: 467367:0687c4808a1e
user: grant <grant%pkgsrc.org@localhost>
date: Fri Jan 30 08:51:29 2004 +0000
description:
print a useful error if the pkgsrc directory or src directory
doesn't exist.
diffstat:
mk/bulk/mksandbox | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r c631e06c15d8 -r 0687c4808a1e mk/bulk/mksandbox
--- a/mk/bulk/mksandbox Fri Jan 30 08:34:28 2004 +0000
+++ b/mk/bulk/mksandbox Fri Jan 30 08:51:29 2004 +0000
@@ -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 @@
exit 1
}
+err()
+{
+ echo "error: $1"
+ exit 1
+}
+
opsys=`uname -s`
case "$opsys" in
Darwin)
@@ -141,8 +147,15 @@
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
Home |
Main Index |
Thread Index |
Old Index