Whamcloud - gitweb
- use $() for execing
authorccooper <ccooper>
Wed, 28 Apr 2004 16:10:48 +0000 (16:10 +0000)
committerccooper <ccooper>
Wed, 28 Apr 2004 16:10:48 +0000 (16:10 +0000)
- ignore errors

lustre/scripts/lbuild

index 3664e02..0043b40 100755 (executable)
@@ -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