HBASE-21999 [DEBUG] Exit if git returns empty revision!

This commit is contained in:
stack 2019-03-06 16:44:50 -08:00
parent 18d02ffd5d
commit 0d69f84bd2
1 changed files with 8 additions and 4 deletions

View File

@ -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`