summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-01-23 22:02:52 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:13 -0500
commit19907887fcc1fa96f947298da752f410eb23ad1e (patch)
tree08e1be2dbe15a6cc3ba7dcf1940ef89bfffa063a /source3
parentbdc6f05af5419d7ade6d944789abcd0abc4a4ebd (diff)
downloadsamba-19907887fcc1fa96f947298da752f410eb23ad1e.tar.gz
samba-19907887fcc1fa96f947298da752f410eb23ad1e.tar.bz2
samba-19907887fcc1fa96f947298da752f410eb23ad1e.zip
r13093: adding vendor patch level string as announced on samba-technical ml
(This used to be commit d40f06018b9197c35a10cc9ab284dd596244f47b)
Diffstat (limited to 'source3')
-rw-r--r--source3/VERSION7
-rw-r--r--source3/lib/version.c6
-rwxr-xr-xsource3/script/mkversion.sh33
3 files changed, 36 insertions, 10 deletions
diff --git a/source3/VERSION b/source3/VERSION
index 5e2b8df386..5119a95401 100644
--- a/source3/VERSION
+++ b/source3/VERSION
@@ -1,6 +1,12 @@
########################################################
# SAMBA Version #
# #
+# Samba versions are as follows #
+# 3.0.x New production series #
+# 3.0.x{pre,rc}y Preview/Testing & RC #
+# 3.0.x[a-z] Patch releases #
+# 3.0.x[a-z]-VENDOR-z Vendor patch releases #
+# #
# script/mkversion.sh #
# will use this file to create #
# include/version.h #
@@ -91,3 +97,4 @@ SAMBA_VERSION_IS_SVN_SNAPSHOT=yes
# -> "CVS 3.0.0rc2-VendorVersion" #
########################################################
SAMBA_VERSION_VENDOR_SUFFIX=
+SAMBA_VENDOR_PATCH=
diff --git a/source3/lib/version.c b/source3/lib/version.c
index 99f836c2d5..3bd8304012 100644
--- a/source3/lib/version.c
+++ b/source3/lib/version.c
@@ -27,6 +27,7 @@ const char *samba_version_string(void)
return SAMBA_VERSION_OFFICIAL_STRING;
#else
static fstring samba_version;
+ fstring tmp_version;
static BOOL init_samba_version;
if (init_samba_version)
@@ -36,6 +37,11 @@ const char *samba_version_string(void)
SAMBA_VERSION_OFFICIAL_STRING,
SAMBA_VERSION_VENDOR_SUFFIX);
+#ifdef SAMBA_VENDOR_PATCH
+ fstr_sprintf( tmp_version, "-%d", SAMBA_VENDOR_PATCH );
+ fstrcat( samba_version, tmp_version );
+#endif
+
init_samba_version = True;
return samba_version;
#endif
diff --git a/source3/script/mkversion.sh b/source3/script/mkversion.sh
index 9d919cfe34..1ba7cd6369 100755
--- a/source3/script/mkversion.sh
+++ b/source3/script/mkversion.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-#
VERSION_FILE=$1
OUTPUT_FILE=$2
@@ -17,16 +16,12 @@ 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_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_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`
echo "/* Autogenerated by script/mkversion.sh */" > $OUTPUT_FILE
@@ -35,13 +30,21 @@ echo "#define SAMBA_VERSION_MINOR ${SAMBA_VERSION_MINOR}" >> $OUTPUT_FILE
echo "#define SAMBA_VERSION_RELEASE ${SAMBA_VERSION_RELEASE}" >> $OUTPUT_FILE
+##
+## start with "3.0.22"
+##
SAMBA_VERSION_STRING="${SAMBA_VERSION_MAJOR}.${SAMBA_VERSION_MINOR}.${SAMBA_VERSION_RELEASE}"
+##
+## maybe add "3.0.22a" 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_PRE_RELEASE}";then
+ ## maybe add "3.0.22pre2"
SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING}pre${SAMBA_VERSION_PRE_RELEASE}"
echo "#define SAMBA_VERSION_PRE_RELEASE ${SAMBA_VERSION_PRE_RELEASE}" >> $OUTPUT_FILE
elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
@@ -49,7 +52,21 @@ elif test -n "${SAMBA_VERSION_RC_RELEASE}";then
echo "#define SAMBA_VERSION_RC_RELEASE ${SAMBA_VERSION_RC_RELEASE}" >> $OUTPUT_FILE
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?
+##
if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
_SAVE_LANG=${LANG}
LANG=""
@@ -78,10 +95,6 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
LANG=${_SAVE_LANG}
fi
-if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
- echo "#define SAMBA_VERSION_VENDOR_SUFFIX ${SAMBA_VERSION_VENDOR_SUFFIX}" >> $OUTPUT_FILE
-fi
-
echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE