You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by ka...@apache.org on 2011/09/16 23:42:55 UTC
svn commit: r1171811 - /incubator/oozie/trunk/bin/mkdistro.sh
Author: kamrul
Date: Fri Sep 16 21:42:54 2011
New Revision: 1171811
URL: http://svn.apache.org/viewvc?rev=1171811&view=rev
Log:
Closes OOZIE-558 Modify bin/mkdistro.sh to refer to svn instead of git
Modified:
incubator/oozie/trunk/bin/mkdistro.sh
Modified: incubator/oozie/trunk/bin/mkdistro.sh
URL: http://svn.apache.org/viewvc/incubator/oozie/trunk/bin/mkdistro.sh?rev=1171811&r1=1171810&r2=1171811&view=diff
==============================================================================
--- incubator/oozie/trunk/bin/mkdistro.sh (original)
+++ incubator/oozie/trunk/bin/mkdistro.sh Fri Sep 16 21:42:54 2011
@@ -17,6 +17,33 @@
# limitations under the License.
#
+#Utility method
+function setRevUrl() {
+ #Checking svn first
+ if which svn >/dev/null; then
+ if [ -d ".svn" ]; then
+ export VC_REV=`svn info | grep "Revision" | awk '{print $2}'`
+ export VC_URL=`svn info | grep "URL" | awk '{print $2}'`
+ fi
+ fi
+
+ #Checking for git if SVN is not there
+ if [ "${VC_REV}" == "" ]; then
+ if which git >/dev/null; then
+ if [ -d ".git" ]; then
+ export VC_REV=`git branch -v | awk '/^\*/ {printf("%s@%s\n", $2, $3); }'`
+ export VC_URL=`git remote -v | grep origin | grep fetch | awk '{print $2}'`
+ fi
+ fi
+ fi
+
+ #If nothing found
+ if [ "${VC_REV}" == "" ]; then
+ export VC_REV="unavailable"
+ export VC_URL="unavailable"
+ fi
+}
+
# resolve links - $0 may be a softlink
PRG="${0}"
@@ -36,9 +63,7 @@ BASEDIR=`cd ${BASEDIR}/..;pwd`
cd ${BASEDIR}
export DATETIME=`date -u "+%Y.%m.%d-%H:%M:%SGMT"`
-export VC_REV=`git branch -v | awk '/^\*/ {printf("%s@%s\n", $2, $3); }'`
-# Out canonical repo is @GitHub -- hence hardcoding
-export VC_URL="git://github.com/yahoo/oozie.git"
+setRevUrl
MVN_OPTS="-Dbuild.time=${DATETIME} -Dvc.revision=${VC_REV} -Dvc.url=${VC_URL} -DgenerateDocs"