Repository: spark
Updated Branches:
  refs/heads/master 0e0686d3e -> b8f2e13ae


[SPARK-2233] make-distribution script should list the git hash in the RELEASE 
file

This patch adds the git revision hash (short version) to the RELEASE file. It 
uses git instead of simply checking for the existence of .git, so as to make 
sure that this is a functional repository.

Author: Guillaume Ballet <[email protected]>

Closes #1216 from gballet/master and squashes the following commits:

eabc50f [Guillaume Ballet] Refactored the script to take comments into account.
d93e5e8 [Guillaume Ballet] [SPARK 2233] make-distribution script now lists the 
git hash tag in the RELEASE file.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b8f2e13a
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b8f2e13a
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b8f2e13a

Branch: refs/heads/master
Commit: b8f2e13aec715e038bd6d1d07b607683f138ac83
Parents: 0e0686d
Author: Guillaume Ballet <[email protected]>
Authored: Sat Jun 28 13:07:12 2014 -0700
Committer: Patrick Wendell <[email protected]>
Committed: Sat Jun 28 13:07:12 2014 -0700

----------------------------------------------------------------------
 make-distribution.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/b8f2e13a/make-distribution.sh
----------------------------------------------------------------------
diff --git a/make-distribution.sh b/make-distribution.sh
index 8686843..94b473b 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -100,6 +100,14 @@ if [ -z "$JAVA_HOME" ]; then
   exit -1
 fi
 
+if which git &>/dev/null; then
+    GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
+    if [ ! -z $GITREV ]; then
+        GITREVSTRING=" (git revision $GITREV)"
+    fi
+    unset GITREV
+fi
+
 if ! which mvn &>/dev/null; then
     echo -e "You need Maven installed to build Spark."
     echo -e "Download Maven from https://maven.apache.org/";
@@ -186,7 +194,7 @@ ${BUILD_COMMAND}
 # Make directories
 rm -rf "$DISTDIR"
 mkdir -p "$DISTDIR/lib"
-echo "Spark $VERSION built for Hadoop $SPARK_HADOOP_VERSION" > 
"$DISTDIR/RELEASE"
+echo "Spark $VERSION$GITREVSTRING built for Hadoop $SPARK_HADOOP_VERSION" > 
"$DISTDIR/RELEASE"
 
 # Copy jars
 cp $FWDIR/assembly/target/scala*/*assembly*hadoop*.jar "$DISTDIR/lib/"

Reply via email to