summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2007-06-26 06:04:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:53:28 -0500
commita1d45c6280cfbd13100e4ec4c61774b7ad830b5c (patch)
tree5d70429c6a11d1fa0943bffec5eecc563f369b6d /source4
parent1f193bf76da65012a8529f93e6e21d558db15674 (diff)
downloadsamba-a1d45c6280cfbd13100e4ec4c61774b7ad830b5c.tar.gz
samba-a1d45c6280cfbd13100e4ec4c61774b7ad830b5c.tar.bz2
samba-a1d45c6280cfbd13100e4ec4c61774b7ad830b5c.zip
r23605: 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 (This used to be commit 03be540ee396379fa230a915f39dda734f93ea55)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/script/mkversion.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh
index bf829410ac..4bb0c7b5b0 100755
--- a/source4/script/mkversion.sh
+++ b/source4/script/mkversion.sh
@@ -104,6 +104,18 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
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 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
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