hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [hbase] branch branch-2 updated: HBASE-21999 [DEBUG] Exit if git returns empty revision!
Date Thu, 07 Mar 2019 00:45:59 GMT
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new 41be1fb  HBASE-21999 [DEBUG] Exit if git returns empty revision!
41be1fb is described below

commit 41be1fbd8b525bca206b7e47d4992a4c7f16bb97
Author: stack <stack@apache.org>
AuthorDate: Wed Mar 6 16:44:50 2019 -0800

    HBASE-21999 [DEBUG] Exit if git returns empty revision!
---
 hbase-common/src/saveVersion.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hbase-common/src/saveVersion.sh b/hbase-common/src/saveVersion.sh
index 730224f..97fe6b4 100644
--- a/hbase-common/src/saveVersion.sh
+++ b/hbase-common/src/saveVersion.sh
@@ -18,6 +18,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -e
+
 unset LANG
 unset LC_CTYPE
 
@@ -45,10 +47,12 @@ else
   revision="Unknown"
   url="file://$cwd"
 fi
-which md5sum > /dev/null
-if [ "$?" != "0" ] ; then
-  which md5 > /dev/null
-  if [ "$?" != "0" ] ; then
+if [ -z $revision ]; then
+  echo "$revision is empty!"
+  exit 1
+fi
+if ! [  -x "$(command -v md5sum)" ]; then
+  if ! [ -x "$(command -v md5)" ]; then
     srcChecksum="Unknown"
   else
     srcChecksum=`find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort |
xargs md5 | md5 | cut -d ' ' -f 1`


Mime
View raw message