summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmcmahill <dmcmahill@pkgsrc.org>2005-05-24 21:48:22 +0000
committerdmcmahill <dmcmahill@pkgsrc.org>2005-05-24 21:48:22 +0000
commit93521480a1bdb2863bce0d2ff798022c511575c8 (patch)
tree010088051be898310c7262fdd0e89ae2a05adc1f
parentf975a8d8d51eaeaf1f45c63818f5feca0d257827 (diff)
downloadpkgsrc-93521480a1bdb2863bce0d2ff798022c511575c8.tar.gz
Add more error checking. PACKAGES must exist. No extra command line args taken.
-rwxr-xr-xmk/scripts/binpkg-cache13
1 files changed, 12 insertions, 1 deletions
diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache
index d38a372dba0..81d0d0f3398 100755
--- a/mk/scripts/binpkg-cache
+++ b/mk/scripts/binpkg-cache
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: binpkg-cache,v 1.5 2005/05/24 20:56:47 dmcmahill Exp $
+# $NetBSD: binpkg-cache,v 1.6 2005/05/24 21:48:22 dmcmahill Exp $
#
# Script for generating a cache file with information about
# all binary packages contained in a directory.
@@ -318,6 +318,17 @@ do
esac
done
+if test $# -ne 0 ; then
+ echo "$0: $* is invalid"
+ usage
+ clean_and_exit1
+fi
+
+if test ! -d ${PACKAGES} ; then
+ echo "Packages directory ${PACKAGES} seems to be missing"
+ clean_and_exit1
+fi
+
# put a trailing / after ${PACKAGES} in case ${PACKAGES} is
# a link.
for d in `${FIND} ${PACKAGES}/ -type d -print` ; do