mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
r15510: As discussed on samba-technical, move the VERSION system back to a
#define based system only. This avoids allocation in the fault code. Andrew Bartlett
This commit is contained in:
parent
a00063eeb3
commit
31c97b4e67
@ -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=
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
##
|
||||
## 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 "#define SAMBA_VERSION_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUTPUT_FILE
|
||||
|
||||
echo "$0: 'version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")"
|
||||
|
||||
if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then
|
||||
echo "$0: with RELEASE_NICKNAME = ${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
|
||||
|
||||
exit 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user