From 3d2dffb72f4e993d52e125b94f607ad39f703067 Mon Sep 17 00:00:00 2001 From: ccooper Date: Wed, 28 Apr 2004 16:10:48 +0000 Subject: [PATCH] - use $() for execing - ignore errors --- lustre/scripts/lbuild | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/scripts/lbuild b/lustre/scripts/lbuild index 3664e02..0043b40 100755 --- a/lustre/scripts/lbuild +++ b/lustre/scripts/lbuild @@ -150,10 +150,10 @@ check_options() # [ -r "$TARGET_FILE" ] || \ # usage 1 "Target '$TARGET' was not found." - RPMBUILD=`which rpmbuild` - if [ $? -ne 0 -o ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then - RPMBUILD=`which rpm` - if [ $? -ne 0 -o ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then + RPMBUILD=$(which rpmbuild 2>/dev/null | head -1) + if [ ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then + RPMBUILD=$(which rpm 2>/dev/null | head -1) + if [ ! "$RPMBUILD" -o "$RPMBUILD" == "" ]; then usage 1 "Could not find binary for making rpms (tried rpmbuild and rpm)." fi fi -- 1.8.3.1