diff options
author | jlam <jlam@pkgsrc.org> | 2006-01-23 18:38:27 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2006-01-23 18:38:27 +0000 |
commit | f280a32c496d5037bd41e2a4f0c25d1da29a5f7d (patch) | |
tree | c8c73689fe7202e8896983358cb53b3b97ea9aa5 /mk/scripts | |
parent | 2fbc613ce76e06073b4794c6350fdb1b66323537 (diff) | |
download | pkgsrc-f280a32c496d5037bd41e2a4f0c25d1da29a5f7d.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/scripts')
-rwxr-xr-x | mk/scripts/pkg_path | 8 |
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 |