You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2019/03/06 19:36:50 UTC

[hbase] branch branch-2.0 updated: HBASE-21999 [DEBUG] Exit if git returns empty revision! ADDENDUM2

This is an automated email from the ASF dual-hosted git repository.

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


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

commit c6f1dc11757ae4027e5cc183d3c92cd4539a1e92
Author: stack <st...@apache.org>
AuthorDate: Wed Mar 6 11:36:01 2019 -0800

    HBASE-21999 [DEBUG] Exit if git returns empty revision! ADDENDUM2
    
    Add -e and -x (had to change how test for md5 was done so as to not
    use which which returns non-zero on failure -- not what we want)
---
 hbase-common/src/saveVersion.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/hbase-common/src/saveVersion.sh b/hbase-common/src/saveVersion.sh
index e2889ff..8c8bdb6 100644
--- a/hbase-common/src/saveVersion.sh
+++ b/hbase-common/src/saveVersion.sh
@@ -18,6 +18,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -x
+set -e
+
 unset LANG
 unset LC_CTYPE
 
@@ -49,10 +52,8 @@ if [ -z $revision ]; then
   echo "$revision is empty!"
   exit 1
 fi
-which md5sum > /dev/null
-if [ "$?" != "0" ] ; then
-  which md5 > /dev/null
-  if [ "$?" != "0" ] ; then
+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`