You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2020/07/21 08:56:44 UTC
[hbase] branch branch-2 updated: HBASE-24710 Incorrect checksum
calculation in saveVersion.sh (#2056)
This is an automated email from the ASF dual-hosted git repository.
psomogyi 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 e0c917b HBASE-24710 Incorrect checksum calculation in saveVersion.sh (#2056)
e0c917b is described below
commit e0c917b647acc9811660c050ccb98f9d6febabda
Author: Peter Somogyi <ps...@apache.org>
AuthorDate: Tue Jul 21 10:40:22 2020 +0200
HBASE-24710 Incorrect checksum calculation in saveVersion.sh (#2056)
Signed-off-by: Nick Dimiduk <nd...@apache.org>
Signed-off-by: Mingliang Liu <li...@apache.org>
---
hbase-common/src/saveVersion.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/hbase-common/src/saveVersion.sh b/hbase-common/src/saveVersion.sh
index 434e570..f42862d 100644
--- a/hbase-common/src/saveVersion.sh
+++ b/hbase-common/src/saveVersion.sh
@@ -29,19 +29,19 @@ outputDirectory=$2
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
@@ -49,14 +49,14 @@ if [ -z "${revision}" ]; then
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`
+ srcChecksum=$(find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort | xargs gpg --print-md sha512 | gpg --print-md sha512 | tr '\n' ' ' | sed 's/[[:space:]]*//g')
fi
else
- srcChecksum=`find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort | xargs openssl dgst -sha512 | openssl dgst -sha512 | cut -d ' ' -f 1`
+ srcChecksum=$(find hbase-*/src/main/ | grep -e "\.java" -e "\.proto" | LC_ALL=C sort | xargs openssl dgst -sha512 | openssl dgst -sha512 | sed 's/^.* //')
fi
popd