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

metze at samba.org metze at samba.org
Tue Oct 10 15:19:56 GMT 2006


Author: metze
Date: 2006-10-10 15:19:56 +0000 (Tue, 10 Oct 2006)
New Revision: 19229

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

Log:
let mkversion.sh handle bzr trees

metze

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


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172


Modified: branches/SAMBA_4_0/source/script/mkversion.sh
===================================================================
--- branches/SAMBA_4_0/source/script/mkversion.sh	2006-10-10 10:41:20 UTC (rev 19228)
+++ branches/SAMBA_4_0/source/script/mkversion.sh	2006-10-10 15:19:56 UTC (rev 19229)
@@ -68,22 +68,42 @@
 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 @@
 	    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



More information about the samba-cvs mailing list