svn commit: samba r23605 - in branches/SAMBA_4_0/source/script: .

kai at samba.org kai at samba.org
Tue Jun 26 06:04:15 GMT 2007


Author: kai
Date: 2007-06-26 06:04:14 +0000 (Tue, 26 Jun 2007)
New Revision: 23605

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23605

Log:
Update mkversion.sh to support git and git-svn checkouts.
Jerry, did I get you right that you'll merge this to 3_0 yourself?

Kai

Modified:
   branches/SAMBA_4_0/source/script/mkversion.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/mkversion.sh
===================================================================
--- branches/SAMBA_4_0/source/script/mkversion.sh	2007-06-26 05:08:50 UTC (rev 23604)
+++ branches/SAMBA_4_0/source/script/mkversion.sh	2007-06-26 06:04:14 UTC (rev 23605)
@@ -104,6 +104,18 @@
 	TMP_CLEAN_TREE=`echo -e "${BZR_INFO}" | grep 'clean:' |sed -e 's/clean: \([a-zA-Z]*\).*/\1/'`
     fi
 
+    if test x"${HAVEVER}" != x"yes";then
+	HAVEGIT=no
+        GIT_INFO=`git show --abbrev-commit HEAD 2>/dev/null`
+	TMP_REVISION=`echo -e "${GIT_INFO}" | grep 'commit ' |sed -e 's/commit \([0-9a-f]*\).*/\1/'`
+	if test -n "$TMP_REVISION";then
+	    HAVEGIT=yes
+            HAVEVER=yes
+	fi
+	TMP_MIRRORED_REVISION=`echo -e "${GIT_INFO}" | grep 'git-svn-id' |sed -e 's#^[ ^t]*git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/\(SAMBA_[34]_[0-9]\(_[0-9]\+\)\?@[0-9]*\).*#\1#'`
+    fi
+	
+
     if test x"${HAVESVN}" = x"yes";then
 	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-${TMP_REVISION}"
 	echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> $OUTPUT_FILE
@@ -130,6 +142,14 @@
 	fi
 
 	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-BZR-${TMP_BZR_REVISION_STR}"
+    elif test x"${HAVEGIT}" = x"yes";then
+	TMP_GIT_REVISION_STR="${TMP_REVISION}"
+
+	if test -n "$TMP_MIRRORED_REVISION"; then
+	    TMP_GIT_REVISION_STR="${TMP_GIT_REVISION_STR}-[SVN-${TMP_MIRRORED_REVISION}]"
+	fi
+
+	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-GIT-${TMP_GIT_REVISION_STR}"
     else
 	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
     fi



More information about the samba-cvs mailing list