[PATCH modular 2/2] Verify existence of command specified by --cmd.

Trevor Woerner twoerner at gmail.com
Fri Oct 22 13:08:22 PDT 2010


From: Trevor Woerner <twoerner at gmail.com>

Signed-off-by: Trevor Woerner <twoerner at gmail.com>
---
 build.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/build.sh b/build.sh
index 8d7b5bf..1898d33 100755
--- a/build.sh
+++ b/build.sh
@@ -1060,6 +1060,16 @@ do
 	shift
 	cmd1=`echo $1 | cut -d' ' -f1`
 	cmd2=`echo $1 | cut -d' ' -f2`
+
+	# verify the command exists
+	which $cmd1 > /dev/null 2> /dev/null
+	if [ $? -ne 0 ]; then
+	    echo "The specified command '$cmd1' does not appear to exist"
+	    echo ""
+	    usage
+	    exit 1
+	fi
+
 	case X"$cmd1" in
 	    X"git")
 		GITCMD=$1
-- 
1.7.3.1.127.g1bb28



More information about the xorg-devel mailing list