pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/scripts If the package directory doesn't exist, the...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/08f535a9b303
branches:  trunk
changeset: 506905:08f535a9b303
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Mon Jan 23 18:38:27 2006 +0000

description:
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:

 mk/scripts/pkg_path |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 2dea46885694 -r 08f535a9b303 mk/scripts/pkg_path
--- a/mk/scripts/pkg_path       Mon Jan 23 18:37:18 2006 +0000
+++ b/mk/scripts/pkg_path       Mon Jan 23 18:38:27 2006 +0000
@@ -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 @@
        ${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 @@
        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 @@
        ${ECHO} "$pkgpath"
 done
 
-exit 0
+exit $exitcode



Home | Main Index | Thread Index | Old Index