liuml07 commented on a change in pull request #2056:
URL: https://github.com/apache/hbase/pull/2056#discussion_r457739472



##########
File path: hbase-common/src/saveVersion.sh
##########
@@ -30,34 +30,34 @@ nativeOutputDirectory="$2/native/utils/"
 pushd .
 cd ..
 
-user=`whoami | sed -n -e 's/\\\/\\\\\\\\/p'`
+user=$(whoami | sed -n -e "s/\\\/\\\\\\\\/p")
 if [ "$user" == "" ]
 then
-  user=`whoami`
+  user=$(whoami)
 fi
-date=`date`
-cwd=`pwd`
+date=$(date)
+cwd=$(pwd)
 if [ -d .svn ]; then
-  revision=`(svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p') || true`
-  url=`(svn info | sed -n -e 's/^URL: \(.*\)/\1/p') || true`
+  revision=$( (svn info | sed -n -e "s/Last Changed Rev: \(.*\)/\1/p") || true)
+  url=$( (svn info | sed -n -e 's/^URL: \(.*\)/\1/p') || true)
 elif [ -d .git ]; then
-  revision=`git log -1 --no-show-signature --pretty=format:"%H" || true`
-  hostname=`hostname`
+  revision=$(git log -1 --no-show-signature --pretty=format:"%H" || true)
+  hostname=$(hostname)
   url="git://${hostname}${cwd}"
 fi
 if [ -z "${revision}" ]; then
   echo "[WARN] revision info is empty! either we're not in VCS or VCS commands 
failed." >&2
   revision="Unknown"
   url="file://$cwd"
 fi
-if ! [  -x "$(command -v openssl)" ]; then
+if ! [ -x "$(command -v openssl)" ]; then
   if ! [ -x "$(command -v gpg)" ]; then
     srcChecksum="Unknown"
   else
-    srcChecksum=`find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | 
LC_ALL=C sort | xargs gpg --print-md sha512 | gpg --print-md sha512 | cut -d ' 
' -f 1`

Review comment:
       That's weird. I did not see in my macOS and Ubuntu Linux. But since this 
is not reliable, I guess we can stay with your script `tr` and `sed` - which 
works for me on both macOS and Ubuntu.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to