[SCM] Samba Shared Repository - branch v3-0-test updated - initial-v3-0-unstable-9-gd2a42b4

Stefan Metzmacher metze at samba.org
Wed Oct 17 08:05:07 GMT 2007


The branch, v3-0-test has been updated
       via  d2a42b4b53362bd3873467ad8849a5e884c818d2 (commit)
       via  918dd7dfd4d6611079d430f9df45fcc53d675682 (commit)
       via  efe56c9de5b4e451917388c126ae9f6c6bd58970 (commit)
      from  5ec7b9f8b9941c1a0adcd10d52fdffc893c1b1a1 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit d2a42b4b53362bd3873467ad8849a5e884c818d2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Oct 17 10:03:22 2007 +0200

    SAMBA_VERSION_VENDOR_SUFFIX="test"
    
    metze

commit 918dd7dfd4d6611079d430f9df45fcc53d675682
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Oct 15 15:52:30 2007 -0700

    Fix warning messages for unused variables.
    Jeremy.
    (cherry picked from commit 406737cd9a34ac498e5823b380e1768d41e16c1b)

commit efe56c9de5b4e451917388c126ae9f6c6bd58970
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Oct 11 12:27:38 2007 +0200

    prepare the mkversion.sh infrastructure for git branches in the build-farm
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/VERSION             |    4 +-
 source/configure.in        |   17 ++++++-
 source/lib/version.c       |    4 +-
 source/script/mkversion.sh |  102 ++++++++++++++++++++++++-------------------
 4 files changed, 76 insertions(+), 51 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/VERSION b/source/VERSION
index 35d0703..dac2ecd 100644
--- a/source/VERSION
+++ b/source/VERSION
@@ -68,7 +68,7 @@ SAMBA_VERSION_RC_RELEASE=
 # e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes               #
 #  ->  "3.0.0-SVN-build-199"                           #
 ########################################################
-SAMBA_VERSION_IS_SVN_SNAPSHOT=yes
+SAMBA_VERSION_IS_GIT_SNAPSHOT=yes
 
 ########################################################
 # This can be set by vendors if they want...           #
@@ -95,5 +95,5 @@ SAMBA_VERSION_IS_SVN_SNAPSHOT=yes
 # e.g. SAMBA_VERSION_VENDOR_SUFFIX=vendor_version()    #
 #  ->  "CVS 3.0.0rc2-VendorVersion"                    #
 ########################################################
-SAMBA_VERSION_VENDOR_SUFFIX=
+SAMBA_VERSION_VENDOR_SUFFIX="test"
 SAMBA_VENDOR_PATCH=
diff --git a/source/configure.in b/source/configure.in
index 74fc873..91f1582 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -9,9 +9,20 @@ AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
 SMB_VERSION_STRING=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_OFFICIAL_STRING' | cut -d '"' -f2`
 echo "SAMBA VERSION: ${SMB_VERSION_STRING}"
 
-SAMBA_VERSION_SVN_REVISION=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_SVN_REVISION' | cut -d ' ' -f3-`
-if test -n "${SAMBA_VERSION_SVN_REVISION}";then
-	echo "BUILD REVISION: ${SAMBA_VERSION_SVN_REVISION}"
+SAMBA_VERSION_GIT_COMMIT_FULLREV=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_FULLREV' | cut -d ' ' -f3- | cut -d '"' -f2`
+if test -n "${SAMBA_VERSION_GIT_COMMIT_FULLREV}";then
+	echo "BUILD COMMIT REVISION: ${SAMBA_VERSION_GIT_COMMIT_FULLREV}"
+fi
+SAMBA_VERSION_GIT_COMMIT_DATE=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_DATE' | cut -d ' ' -f3-`
+if test -n "${SAMBA_VERSION_GIT_COMMIT_DATE}";then
+	echo "BUILD COMMIT DATE: ${SAMBA_VERSION_GIT_COMMIT_DATE}"
+fi
+SAMBA_VERSION_GIT_COMMIT_TIME=`cat $srcdir/include/version.h | grep 'SAMBA_VERSION_GIT_COMMIT_TIME' | cut -d ' ' -f3-`
+if test -n "${SAMBA_VERSION_GIT_COMMIT_TIME}";then
+	echo "BUILD COMMIT TIME: ${SAMBA_VERSION_GIT_COMMIT_TIME}"
+
+	# just to keep the build-farm gui happy for now...
+	echo "BUILD REVISION: ${SAMBA_VERSION_GIT_COMMIT_TIME}"
 fi
 
 AC_LIBREPLACE_LOCATION_CHECKS
diff --git a/source/lib/version.c b/source/lib/version.c
index a20d650..ee8c3eb 100644
--- a/source/lib/version.c
+++ b/source/lib/version.c
@@ -27,9 +27,11 @@ const char *samba_version_string(void)
 	return SAMBA_VERSION_OFFICIAL_STRING;
 #else
 	static fstring samba_version;
-	fstring tmp_version;
 	static BOOL init_samba_version;
+#ifdef SAMBA_VENDOR_PATCH
+	fstring tmp_version;
 	size_t remaining;
+#endif
 
 	if (init_samba_version)
 		return samba_version;
diff --git a/source/script/mkversion.sh b/source/script/mkversion.sh
index aee7d0a..877138f 100755
--- a/source/script/mkversion.sh
+++ b/source/script/mkversion.sh
@@ -16,12 +16,19 @@ SOURCE_DIR=$3
 SAMBA_VERSION_MAJOR=`sed -n 's/^SAMBA_VERSION_MAJOR=//p' $SOURCE_DIR$VERSION_FILE`
 SAMBA_VERSION_MINOR=`sed -n 's/^SAMBA_VERSION_MINOR=//p' $SOURCE_DIR$VERSION_FILE`
 SAMBA_VERSION_RELEASE=`sed -n 's/^SAMBA_VERSION_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
+
 SAMBA_VERSION_REVISION=`sed -n 's/^SAMBA_VERSION_REVISION=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_TP_RELEASE=`sed -n 's/^SAMBA_VERSION_TP_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
 SAMBA_VERSION_PRE_RELEASE=`sed -n 's/^SAMBA_VERSION_PRE_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
 SAMBA_VERSION_RC_RELEASE=`sed -n 's/^SAMBA_VERSION_RC_RELEASE=//p' $SOURCE_DIR$VERSION_FILE`
-SAMBA_VERSION_IS_SVN_SNAPSHOT=`sed -n 's/^SAMBA_VERSION_IS_SVN_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_IS_GIT_SNAPSHOT=`sed -n 's/^SAMBA_VERSION_IS_GIT_SNAPSHOT=//p' $SOURCE_DIR$VERSION_FILE`
+
+SAMBA_VERSION_RELEASE_NICKNAME=`sed -n 's/^SAMBA_VERSION_RELEASE_NICKNAME=//p' $SOURCE_DIR$VERSION_FILE`
+
 SAMBA_VERSION_VENDOR_SUFFIX=`sed -n 's/^SAMBA_VERSION_VENDOR_SUFFIX=//p' $SOURCE_DIR$VERSION_FILE`
-SAMBA_VENDOR_PATCH=`sed -n 's/^SAMBA_VENDOR_PATCH=//p' $SOURCE_DIR$VERSION_FILE`
+SAMBA_VERSION_VENDOR_PATCH=`sed -n 's/^SAMBA_VERSION_VENDOR_PATCH=//p' $SOURCE_DIR$VERSION_FILE`
 
 echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE
 
@@ -37,12 +44,15 @@ SAMBA_VERSION_STRING="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERS
 
 
 ##
-## maybe add "3.0.22a" or "3.0.22pre1" or "3.0.22rc1"
+## maybe add "3.0.22a" or "4.0.0tp11" or "3.0.22pre1" or "3.0.22rc1"
 ## We do not do pre or rc version on patch/letter releases
 ##
 if test -n "${SAMBA_VERSION_REVISION}";then
     SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}${SAMBA_VERSION_REVISION}"
     echo "#define SAMBA_VERSION_REVISION \"${SAMBA_VERSION_REVISION}\"" >> $OUTPUT_FILE
+elif test -n "${SAMBA_VERSION_TP_RELEASE}";then
+    SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}tp${SAMBA_VERSION_TP_RELEASE}"
+    echo "#define SAMBA_VERSION_TP_RELEASE ${SAMBA_VERSION_TP_RELEASE}" >> $OUTPUT_FILE
 elif test -n "${SAMBA_VERSION_PRE_RELEASE}";then
     ## maybe add "3.0.22pre2"
     SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}pre${SAMBA_VERSION_PRE_RELEASE}"
@@ -53,61 +63,63 @@ elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
 fi
 
 ##
-## Add the vendor string if present
-##
-if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
-    echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
-    if test -n "${SAMBA_VENDOR_PATCH}";then
-        echo "#define SAMBA_VENDOR_PATCH ${SAMBA_VENDOR_PATCH}" >> $OUTPUT_FILE
-    fi
-fi
-
-
-
-##
-## SVN revision number? 
+## GIT commit details
 ##
-if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
+if test x"${SAMBA_VERSION_IS_GIT_SNAPSHOT}" = x"yes";then
     _SAVE_LANG=${LANG}
-    LANG=""
-    HAVESVN=no
-    svn info ${SOURCE_DIR} >/dev/null 2>&1 && HAVESVN=yes
-    TMP_REVISION=`(svn info ${SOURCE_DIR} 2>/dev/null || svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Last Changed Rev.*:' |sed -e 's/Last Changed Rev.*: \([0-9]*\).*/\1/'`
-    if test x"${HAVESVN}" = x"no";then
-	HAVESVK=no
-	svk info ${SOURCE_DIR} >/dev/null 2>&1 && HAVESVK=yes
-	TMP_MIRRORED_REVISION=`(svk info ${SOURCE_DIR} 2>/dev/null) |grep 'Mirrored From:.*samba\.org.*' |sed -e 's/Mirrored From: .* Rev\..* \([0-9]*\).*/\1/'`
-	if test -n "$TMP_MIRRORED_REVISION"; then
-	    TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}-[SVN-${TMP_MIRRORED_REVISION}]"
-	else
-	    TMP_SVK_REVISION_STR="${TMP_REVISION}-${USER}@${HOSTNAME}"
+    LANG="C"
+    HAVEVER="no"
+
+    if test x"${HAVEVER}" != x"yes" -a -d "${SOURCE_DIR}../.git";then
+	HAVEGIT=no
+	GIT_INFO=`git show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD 2>/dev/null`
+	GIT_COMMIT_ABBREV=`echo -e "${GIT_INFO}" | sed -n 1p`
+	GIT_COMMIT_TIME=`echo -e "${GIT_INFO}" | sed -n 2p`
+	GIT_COMMIT_FULLREV=`echo -e "${GIT_INFO}" | sed -n 3p`
+	GIT_COMMIT_DATE=`echo -e "${GIT_INFO}" | sed -n 4p`
+	if test -n "${GIT_COMMIT_ABBREV}";then
+	    HAVEGIT=yes
+            HAVEVER=yes
 	fi
     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
-    elif test x"${HAVESVK}" = x"yes";then
-	    SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVK-build-${TMP_SVK_REVISION_STR}"
+    if test x"${HAVEGIT}" = x"yes";then
+	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-GIT-${GIT_COMMIT_ABBREV}"
+
+	echo "#define SAMBA_VERSION_GIT_COMMIT_ABBREV \"${GIT_COMMIT_ABBREV}\"" >> $OUTPUT_FILE
+	echo "#define SAMBA_VERSION_GIT_COMMIT_TIME ${GIT_COMMIT_TIME}" >> $OUTPUT_FILE
+	echo "#define SAMBA_VERSION_GIT_COMMIT_FULLREV \"${GIT_COMMIT_FULLREV}\"" >> $OUTPUT_FILE
+	echo "#define SAMBA_VERSION_GIT_COMMIT_DATE \"${GIT_COMMIT_DATE}\"" >> $OUTPUT_FILE
     else
-	    SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-SVN-build-UNKNOWN"
+	SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-GIT-UNKNOWN"
     fi
     LANG=${_SAVE_LANG}
 fi
 
 echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
 
-echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
-
-echo "$0: 'include/version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
-
+##
+## Add the vendor string if present
+##
 if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
-    echo -n "$0: with VENDOR_SUFFIX = \""
-    echo -n ${SAMBA_VERSION_VENDOR_SUFFIX} | sed 's/"//g'
-    if test -n "${SAMBA_VENDOR_PATCH}"; then
-       echo -n "-${SAMBA_VENDOR_PATCH}"
-   fi
-   echo "\""
+    echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
+    SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-${SAMBA_VERSION_VENDOR_SUFFIX}"
+    if test -n "${SAMBA_VERSION_VENDOR_PATCH}";then
+        echo "#define SAMBA_VERSION_VENDOR_PATCH ${SAMBA_VERSION_VENDOR_PATCH}" >> $OUTPUT_FILE
+        SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}-${SAMBA_VERSION_VENDOR_PATCH}"
+    fi
 fi
 
+##
+## Add a release nickname
+##
+if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
+    echo "#define SAMBA_VERSION_RELEASE_NICKNAME ${SAMBA_VERSION_RELEASE_NICKNAME}" >> $OUTPUT_FILE
+    SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING} (${SAMBA_VERSION_RELEASE_NICKNAME})"
+fi
+
+echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
+
+echo "$0: '$OUTPUT_FILE' created for Samba(\"${SAMBA_VERSION_STRING}\")"
+
 exit 0


-- 
Samba Shared Repository


More information about the samba-cvs mailing list