HBASE-24710 Incorrect checksum calculation in saveVersion.sh (#2056)
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org> Signed-off-by: Mingliang Liu <liuml07@apache.org>
This commit is contained in:
parent
f2c087caeb
commit
ea96743dd2
|
@ -30,19 +30,19 @@ nativeOutputDirectory="$2/native/utils/"
|
||||||
pushd .
|
pushd .
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
user=`whoami | sed -n -e 's/\\\/\\\\\\\\/p'`
|
user=$(whoami | sed -n -e "s/\\\/\\\\\\\\/p")
|
||||||
if [ "$user" == "" ]
|
if [ "$user" == "" ]
|
||||||
then
|
then
|
||||||
user=`whoami`
|
user=$(whoami)
|
||||||
fi
|
fi
|
||||||
date=`date`
|
date=$(date)
|
||||||
cwd=`pwd`
|
cwd=$(pwd)
|
||||||
if [ -d .svn ]; then
|
if [ -d .svn ]; then
|
||||||
revision=`(svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\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`
|
url=$( (svn info | sed -n -e 's/^URL: \(.*\)/\1/p') || true)
|
||||||
elif [ -d .git ]; then
|
elif [ -d .git ]; then
|
||||||
revision=`git log -1 --no-show-signature --pretty=format:"%H" || true`
|
revision=$(git log -1 --no-show-signature --pretty=format:"%H" || true)
|
||||||
hostname=`hostname`
|
hostname=$(hostname)
|
||||||
url="git://${hostname}${cwd}"
|
url="git://${hostname}${cwd}"
|
||||||
fi
|
fi
|
||||||
if [ -z "${revision}" ]; then
|
if [ -z "${revision}" ]; then
|
||||||
|
@ -50,14 +50,14 @@ if [ -z "${revision}" ]; then
|
||||||
revision="Unknown"
|
revision="Unknown"
|
||||||
url="file://$cwd"
|
url="file://$cwd"
|
||||||
fi
|
fi
|
||||||
if ! [ -x "$(command -v openssl)" ]; then
|
if ! [ -x "$(command -v openssl)" ]; then
|
||||||
if ! [ -x "$(command -v gpg)" ]; then
|
if ! [ -x "$(command -v gpg)" ]; then
|
||||||
srcChecksum="Unknown"
|
srcChecksum="Unknown"
|
||||||
else
|
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
|
fi
|
||||||
else
|
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
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue