summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/VERSION18
-rw-r--r--source4/lib/version.c37
-rwxr-xr-xsource4/script/mkversion.sh30
3 files changed, 15 insertions, 70 deletions
diff --git a/source4/VERSION b/source4/VERSION
index 75b1abbd20..79169839c0 100644
--- a/source4/VERSION
+++ b/source4/VERSION
@@ -74,7 +74,7 @@ SAMBA_VERSION_RC_RELEASE=
# in the development BRANCH, and set to 'no' only in #
# the SAMBA_X_X_RELEASE BRANCH #
# #
-# <MAJOR>.<MINOR>.<RELEASE>[...]cvs #
+# <MAJOR>.<MINOR>.<RELEASE>[...]-SVN-build-xxx #
# #
# e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes #
# -> "3.0.0-SVN-build-199" #
@@ -84,7 +84,7 @@ SAMBA_VERSION_IS_SVN_SNAPSHOT=yes
########################################################
# This is for specifying a release nickname #
# #
-# e.g. SAMBA_VERSION_RELEASE_NICKNAME="Nicky Nickname" #
+# e.g. SAMBA_VERSION_RELEASE_NICKNAME=Nicky Nickname #
# smbd --version will then give: #
# -> "4.0.0-tp1-VendorVersion (Nicky Nickname)" #
########################################################
@@ -99,21 +99,9 @@ SAMBA_VERSION_RELEASE_NICKNAME=
# #
# Note the '-' is automaticaly added #
# #
-# e.g. SAMBA_VERSION_VENDOR_SUFFIX="VendorVersion" #
+# e.g. SAMBA_VERSION_VENDOR_SUFFIX=VendorVersion #
# -> "CVS 3.0.0rc2-VendorVersion" #
# #
-# Note: If you want to use a function, #
-# then patch lib/version.c and add this function #
-# there, because the symbol must be available in #
-# binary. #
-# #
-# const char *vendor_version(void) #
-# { #
-# return "VendorVersion"; #
-# } #
-# #
-# e.g. SAMBA_VERSION_VENDOR_SUFFIX=vendor_version() #
-# -> "CVS 3.0.0rc2-VendorVersion" #
########################################################
SAMBA_VERSION_VENDOR_SUFFIX=
SAMBA_VERSION_VENDOR_PATCH=
diff --git a/source4/lib/version.c b/source4/lib/version.c
index b7aa81a081..0ad6a93322 100644
--- a/source4/lib/version.c
+++ b/source4/lib/version.c
@@ -24,40 +24,5 @@
const char *samba_version_string(void)
{
- const char *official_string = SAMBA_VERSION_OFFICIAL_STRING;
-#ifdef SAMBA_VERSION_RELEASE_NICKNAME
- const char *release_nickname = SAMBA_VERSION_RELEASE_NICKNAME;
-#else
- const char *release_nickname = NULL;
-#endif
-#ifdef SAMBA_VERSION_VENDOR_SUFFIX
- const char *vendor_suffix = SAMBA_VERSION_VENDOR_SUFFIX;
-#else
- const char *vendor_suffix = NULL;
-#endif
-#ifdef SAMBA_VERSION_VENDOR_PATCH
- const char *vendor_patch = SAMBA_VERSION_VENDOR_PATCH;
-#else
- const char *vendor_patch = NULL;
-#endif
- static char *samba_version;
- static BOOL init_samba_version;
-
- if (init_samba_version) {
- return samba_version;
- }
-
- samba_version = talloc_asprintf(talloc_autofree_context(),
- "%s%s%s%s%s%s%s%s",
- official_string,
- (vendor_suffix?"-":""),
- (vendor_suffix?vendor_suffix:""),
- (vendor_patch?"-":""),
- (vendor_patch?vendor_patch:""),
- (release_nickname?" (":""),
- (release_nickname?release_nickname:""),
- (release_nickname?")":""));
-
- init_samba_version = True;
- return samba_version;
+ return SAMBA_VERSION_STRING;
}
diff --git a/source4/script/mkversion.sh b/source4/script/mkversion.sh
index 7995027998..0dd80712ff 100755
--- a/source4/script/mkversion.sh
+++ b/source4/script/mkversion.sh
@@ -93,38 +93,30 @@ if test x"${SAMBA_VERSION_IS_SVN_SNAPSHOT}" = x"yes";then
LANG=${_SAVE_LANG}
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
-fi
+echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
##
## 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
+ 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
-echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
-
-echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE
-
-echo "$0: 'version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
-
+##
+## Add a release nickname
+##
if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
- echo "$0: with RELEASE_NICKNAME = ${SAMBA_VERSION_RELEASE_NICKNAME}"
+ echo "#define SAMBA_VERSION_RELEASE_NICKNAME ${SAMBA_VERSION_RELEASE_NICKNAME}" >> $OUTPUT_FILE
+ SAMBA_VERSION_STRING="${SAMBA_VERSION_STRING} (${SAMBA_VERSION_RELEASE_NICKNAME})"
fi
-if test -n "${SAMBA_VERSION_VENDOR_SUFFIX}";then
- echo "$0: with VENDOR_SUFFIX = ${SAMBA_VERSION_VENDOR_SUFFIX}"
- if test -n "${SAMBA_VERSION_VENDOR_PATCH}";then
- echo "$0: with VENDOR_PATCH = ${SAMBA_VERSION_VENDOR_PATCH}"
- fi
-fi
+echo "#define SAMBA_VERSION_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
+
+echo "$0: 'version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
exit 0