summaryrefslogtreecommitdiff
path: root/source4/script/mkversion.sh
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-10-10 15:19:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:55 -0500
commit66f264bd7a90a5aa0e9031f815b3d229416aa431 (patch)
treefbbe181bbb32dedf2636ab9b5a43d3ac22085e44 /source4/script/mkversion.sh
parentd067ee2105ac1d64c2b106869fbf93b991f52e11 (diff)
downloadsamba-66f264bd7a90a5aa0e9031f815b3d229416aa431.tar.gz
samba-66f264bd7a90a5aa0e9031f815b3d229416aa431.tar.bz2
samba-66f264bd7a90a5aa0e9031f815b3d229416aa431.zip
r19229: let mkversion.sh handle bzr trees
metze (This used to be commit 12c8067337e4cecf1fcd3123e4e0e3bb1bbcba8e)
Diffstat (limited to 'source4/script/mkversion.sh')
-rwxr-xr-xsource4/script/mkversion.sh48
1 files changed, 42 insertions, 6 deletions
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh
index 27284d66c4..bf829410ac 100755
--- a/source4/script/mkversion.sh
+++ b/source4/script/mkversion.sh
@@ -68,22 +68,42 @@ fi
if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
_SAVE_LANG=${LANG}
LANG=""
- HAVESVN=no
- SVN_INFO=`svn info ${SOURCE_DIR} 2>/dev/null`
- TMP_REVISION=`echo -e "${SVN_INFO}" | grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'`
- if test -n "$TMP_REVISION"; then
- HAVESVN=yes
+ HAVEVER="no"
+
+ if test x"${HAVEVER}" != x"yes";then
+ HAVESVN=no
+ SVN_INFO=`svn info ${SOURCE_DIR} 2>/dev/null`
+ TMP_REVISION=`echo -e "${SVN_INFO}" | grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'`
+ if test -n "$TMP_REVISION"; then
+ HAVESVN=yes
+ HAVEVER=yes
+ fi
fi
- if test x"${HAVESVN}" != x"yes";then
+
+ if test x"${HAVEVER}" != x"yes";then
HAVESVK=no
SVK_INFO=`svk info ${SOURCE_DIR} 2>/dev/null`
TMP_REVISION=`echo -e "${SVK_INFO}" | grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'`
if test -n "$TMP_REVISION"; then
HAVESVK=yes
+ HAVEVER=yes
fi
TMP_MIRRORED_REVISION=`echo -e "${SVK_INFO}" | grep 'Mirrored From:.*samba\.org.*' |sed -e 's/Mirrored From: .* Rev\..* \([0-9]*\).*/\1/'`
fi
+ if test x"${HAVEVER}" != x"yes";then
+ HAVEBZR=no
+ BZR_INFO=`bzr version-info --check-clean ${SOURCE_DIR} 2>/dev/null`
+ TMP_REVISION=`echo -e "${BZR_INFO}" | grep 'revno:' |sed -e 's/revno: \([0-9]*\).*/\1/'`
+ if test -n "$TMP_REVISION"; then
+ HAVEBZR=yes
+ HAVEVER=yes
+ fi
+ TMP_MIRRORED_REVISION=`echo -e "${BZR_INFO}" | grep 'revision-id: svn-v1:.*@0c0555d6-39d7-0310-84fc-f1cc0bd64818' |sed -e 's/revision-id: svn-v1:\([0-9]*\)@0c0555d6-39d7-0310-84fc-f1cc0bd64818.*/\1/'`
+ TMP_BRANCH_NICK=`echo -e "${BZR_INFO}" | grep 'branch-nick:' |sed -e 's/branch-nick: \(.*\)$/\1/'`
+ TMP_CLEAN_TREE=`echo -e "${BZR_INFO}" | grep 'clean:' |sed -e 's/clean: \([a-zA-Z]*\).*/\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
@@ -94,6 +114,22 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}"
fi
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}"
+ elif test x"${HAVEBZR}" = x"yes";then
+ TMP_BZR_REVISION_STR="${TMP_REVISION}"
+
+ if test -n "$TMP_BRANCH_NICK"; then
+ TMP_BZR_REVISION_STR="${TMP_BZR_REVISION_STR}${TMP_MOD_STR}@${TMP_BRANCH_NICK}"
+ fi
+
+ if test -n "$TMP_MIRRORED_REVISION"; then
+ TMP_BZR_REVISION_STR="${TMP_BZR_REVISION_STR}-[SVN-${TMP_MIRRORED_REVISION}]"
+ fi
+
+ if test x"$TMP_CLEAN_TREE" != x"True"; then
+ TMP_BZR_REVISION_STR="${TMP_BZR_REVISION_STR}-[modified]"
+ fi
+
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-BZR-${TMP_BZR_REVISION_STR}"
else
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
fi