Remove GIT_RELEASE variable and use the semantically identical N2N_VERSION instead

This commit is contained in:
Hamish Coleman 2021-11-01 09:10:14 +00:00
parent 430b0cb77d
commit a9216f1097
6 changed files with 3 additions and 13 deletions

View File

@ -37,7 +37,7 @@ MESSAGE(STATUS "Build from git rev: ${N2N_VERSION}")
endif (GIT_ERROR_CODE EQUAL 0) endif (GIT_ERROR_CODE EQUAL 0)
add_definitions(-DCMAKE_BUILD) add_definitions(-DCMAKE_BUILD)
add_definitions(-DGIT_RELEASE="${N2N_VERSION}" -DPACKAGE_VERSION="${N2N_VERSION}" -DPACKAGE_OSNAME="${N2N_OSNAME}") add_definitions(-DPACKAGE_VERSION="${N2N_VERSION}" -DPACKAGE_OSNAME="${N2N_OSNAME}")
add_definitions(-DN2N_VERSION="${N2N_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}") add_definitions(-DN2N_VERSION="${N2N_VERSION}" -DN2N_OSNAME="${N2N_OSNAME}")

View File

@ -8,9 +8,6 @@ if test -d ".git"; then
# NOTE: keep in sync with the definitions for configure.in files under the packages folder # NOTE: keep in sync with the definitions for configure.in files under the packages folder
GIT_COMMITS=`git rev-list --count HEAD` GIT_COMMITS=`git rev-list --count HEAD`
GIT_REVISION=`git rev-parse --short HEAD` GIT_REVISION=`git rev-parse --short HEAD`
GIT_RELEASE="${N2N_VERSION_SHORT}.r${GIT_COMMITS}.${GIT_REVISION}"
else
GIT_RELEASE=${N2N_VERSION_SHORT}
fi fi
if test "${CC+set}" != set; then if test "${CC+set}" != set; then
@ -108,7 +105,6 @@ dnl> wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=bl
OSNAME=`./config.guess` OSNAME=`./config.guess`
fi fi
AC_DEFINE_UNQUOTED(PACKAGE_OSNAME, "${OSNAME}", [OS name]) AC_DEFINE_UNQUOTED(PACKAGE_OSNAME, "${OSNAME}", [OS name])
AC_DEFINE_UNQUOTED(GIT_RELEASE, "${GIT_RELEASE}", [GIT release])
if test $MACHINE = "x86_64"; then if test $MACHINE = "x86_64"; then
EXTN="amd64" EXTN="amd64"
@ -127,7 +123,6 @@ AC_SUBST(LDFLAGS)
AC_SUBST(N2N_VERSION_SHORT) AC_SUBST(N2N_VERSION_SHORT)
AC_SUBST(GIT_COMMITS) AC_SUBST(GIT_COMMITS)
AC_SUBST(GIT_REVISION) AC_SUBST(GIT_REVISION)
AC_SUBST(GIT_RELEASE)
AC_SUBST(N2N_DEFINES) AC_SUBST(N2N_DEFINES)
AC_SUBST(N2N_LIBS) AC_SUBST(N2N_LIBS)
AC_SUBST(ADDITIONAL_TOOLS) AC_SUBST(ADDITIONAL_TOOLS)

View File

@ -20,5 +20,4 @@ sed \
cat <<EOF >include/config.h cat <<EOF >include/config.h
#define PACKAGE_VERSION "FIXME" #define PACKAGE_VERSION "FIXME"
#define PACKAGE_OSNAME "FIXME" #define PACKAGE_OSNAME "FIXME"
#define GIT_RELEASE "FIXME"
EOF EOF

View File

@ -590,7 +590,7 @@ void print_n2n_version () {
printf("Welcome to n2n v.%s for %s\n" printf("Welcome to n2n v.%s for %s\n"
"Built on %s\n" "Built on %s\n"
"Copyright 2007-2021 - ntop.org and contributors\n\n", "Copyright 2007-2021 - ntop.org and contributors\n\n",
GIT_RELEASE, PACKAGE_OSNAME, PACKAGE_BUILDDATE); N2N_VERSION, PACKAGE_OSNAME, PACKAGE_BUILDDATE);
} }
/* *********************************************** */ /* *********************************************** */

View File

@ -741,7 +741,7 @@ int sn_init_defaults (n2n_sn_t *sss) {
memset(sss, 0, sizeof(n2n_sn_t)); memset(sss, 0, sizeof(n2n_sn_t));
strncpy(sss->version, GIT_RELEASE, sizeof(n2n_version_t)); strncpy(sss->version, N2N_VERSION, sizeof(n2n_version_t));
sss->version[sizeof(n2n_version_t) - 1] = '\0'; sss->version[sizeof(n2n_version_t) - 1] = '\0';
sss->daemon = 1; /* By defult run as a daemon. */ sss->daemon = 1; /* By defult run as a daemon. */
sss->lport = N2N_SN_LPORT_DEFAULT; sss->lport = N2N_SN_LPORT_DEFAULT;

View File

@ -9,7 +9,3 @@
#ifndef PACKAGE_VERSION #ifndef PACKAGE_VERSION
#define PACKAGE_VERSION N2N_VERSION #define PACKAGE_VERSION N2N_VERSION
#endif #endif
#ifndef GIT_RELEASE
#define GIT_RELEASE N2N_VERSION
#endif