Whamcloud - gitweb
EX-687 build: fix to generate lustre version on ubuntu
authorWang Shilong <wshilong@ddn.com>
Fri, 1 Nov 2019 08:03:07 +0000 (16:03 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 6 Mar 2021 09:09:30 +0000 (09:09 +0000)
Problem is dash doesn't support >& operaton and will report
as Syntax error: Bad fd number.

Test-parameters: trivial

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Iafc95756c4981798fe68dd4c51e2d6418335b7dd
Reviewed-on: https://review.whamcloud.com/41831
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LUSTRE-VERSION-GEN

index 80d0c9e..a85286e 100755 (executable)
@@ -34,8 +34,10 @@ else
         VC=unset
 fi
 [ -z $S_VN ] && S_VN=$(echo $VN | awk -F '_' '{print $1}')
-echo $VN | grep ddn >&/dev/null ||
-        VN=$(echo "$VN" | sed -s "s#${S_VN}#${S_VN}_${DDN_VERSION}#")
+echo $VN | grep ddn 1>/dev/null
+if [ $? -ne 0 ]; then
+       VN=$(echo "$VN" | sed -s "s#${S_VN}#${S_VN}_${DDN_VERSION}#")
+fi
 test "$VN" = "$VC" || {
         echo "LUSTRE_VERSION = $VN" >$LVF
 }