r22401: Add bzr revision+nick support to mkversion.sh.
[sfrench/samba-autobuild/.git] / source / script / mkversion.sh
index 578405492135e1172b83cf5e5f48e410faa3a4f9..64f1a778aeb13027d236db7d8a59561a0cf37d88 100755 (executable)
@@ -82,6 +82,13 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
        else
            TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}"
        fi
+       if test x"${HAVESVK}" = x"no";then
+           HAVEBZR=no
+           bzr revno > /dev/null 2>&1 && HAVEBZR=yes
+           TMP_BZR_REVNO=`bzr revno 2> /dev/null`
+           TMP_BZR_NICK=`bzr nick 2> /dev/null`
+           TMP_BZR_REVISION_STR="${TMP_BZR_NICK}-${TMP_BZR_REVNO}"
+       fi
     fi
 
     if test x"${HAVESVN}" = x"yes";then
@@ -89,6 +96,8 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
            echo "#define SAMBA_VERSION_SVN_REVISION ${TMP_REVISION}" >> $OUTPUT_FILE
     elif test x"${HAVESVK}" = x"yes";then
            SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}"
+    elif test x"${HAVEBZR}" = x"yes";then
+           SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-BZR-build-${TMP_BZR_REVISION_STR}"
     else
            SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
     fi