You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2019/03/07 20:39:20 UTC
[hbase] branch branch-2.2 updated: HBASE-21999 ADDENDUM unknown
revisions are okay; make sure we indicate them.
This is an automated email from the ASF dual-hosted git repository.
busbey pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.2 by this push:
new 3ff60b2 HBASE-21999 ADDENDUM unknown revisions are okay; make sure we indicate them.
3ff60b2 is described below
commit 3ff60b2e00bb3ec1fe68a995a12878b521a2953d
Author: Sean Busbey <bu...@apache.org>
AuthorDate: Thu Mar 7 10:33:32 2019 -0600
HBASE-21999 ADDENDUM unknown revisions are okay; make sure we indicate them.
(cherry picked from commit a7bbff170a3af3cec8359dce5f31650ae1bde1c8)
---
hbase-common/pom.xml | 4 ++--
hbase-common/src/saveVersion.sh | 14 ++++++--------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml
index 61107a3..9ecd373 100644
--- a/hbase-common/pom.xml
+++ b/hbase-common/pom.xml
@@ -86,13 +86,13 @@
</execution>
<!-- Generate web app sources -->
<execution>
- <id>generate</id>
+ <id>generate-Version-information</id>
<phase>generate-sources</phase>
<configuration>
<target>
<property name="generated.sources" location="${project.build.directory}/generated-sources"/>
- <exec executable="bash">
+ <exec executable="bash" failonerror="true">
<arg line="${basedir}/src/saveVersion.sh ${project.version} ${generated.sources}/java"/>
</exec>
</target>
diff --git a/hbase-common/src/saveVersion.sh b/hbase-common/src/saveVersion.sh
index 97fe6b4..507bbb0 100644
--- a/hbase-common/src/saveVersion.sh
+++ b/hbase-common/src/saveVersion.sh
@@ -37,20 +37,18 @@ fi
date=`date`
cwd=`pwd`
if [ -d .svn ]; then
- revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
- url=`svn info | sed -n -e 's/^URL: \(.*\)/\1/p'`
+ 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"`
+ revision=`git log -1 --no-show-signature --pretty=format:"%H" || true`
hostname=`hostname`
url="git://${hostname}${cwd}"
-else
+fi
+if [ -z "${revision}" ]; then
+ echo "[WARN] revision info is empty! either we're not in VCS or VCS commands failed." >&2
revision="Unknown"
url="file://$cwd"
fi
-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"