summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-01-23 18:38:27 +0000
committerjlam <jlam@pkgsrc.org>2006-01-23 18:38:27 +0000
commitb032c82c218cce06cfc050097b94a15757bc53f9 (patch)
treec8c73689fe7202e8896983358cb53b3b97ea9aa5 /mk
parentc8acc068afd554af7ddfb24d729cdcd523e5fe3b (diff)
downloadpkgsrc-b032c82c218cce06cfc050097b94a15757bc53f9.tar.gz
If the package directory doesn't exist, then return a non-zero code. This
allows us to distinguish the case where everything is what we expect, and any deviations from that main case.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/scripts/pkg_path8
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/scripts/pkg_path b/mk/scripts/pkg_path
index f9fb6e80335..fdf40e6644f 100755
--- a/mk/scripts/pkg_path
+++ b/mk/scripts/pkg_path
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: pkg_path,v 1.2 2006/01/18 18:21:56 jlam Exp $
+# $NetBSD: pkg_path,v 1.3 2006/01/23 18:38:27 jlam Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -77,6 +77,8 @@ usage() {
${ECHO} 1>&2 "usage: $self [-s pkgsrcdir] dir ..."
}
+exitcode=0
+
# Process optional arguments
while ${TEST} $# -gt 0; do
case "$1" in
@@ -97,11 +99,13 @@ while ${TEST} $# -gt 0; do
case "$dir" in
${PKGSRCDIR}/*) ;;
/*) ${ECHO} 1>&2 "$self: \`\`$dir'' not a valid package directory"
+ exitcode=1
continue
;;
esac
if ${TEST} ! -d "$startdir/$dir"; then
${ECHO} 1>&2 "$self: \`\`$dir'' not found"
+ exitcode=1
continue
fi
pkgpath=`cd $startdir/$dir && ${PWD_CMD}`
@@ -109,4 +113,4 @@ while ${TEST} $# -gt 0; do
${ECHO} "$pkgpath"
done
-exit 0
+exit $exitcode