mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 16:41:11 +02:00
Switch build date to use the last commit time
This reduces binary changes if the same commit version is re-built
This commit is contained in:
parent
7bab59ea0a
commit
267b297150
|
@ -4,6 +4,8 @@ dnl> Do not add anything above
|
||||||
|
|
||||||
N2N_VERSION=${PACKAGE_VERSION}
|
N2N_VERSION=${PACKAGE_VERSION}
|
||||||
|
|
||||||
|
AC_DEFINE([PACKAGE_BUILDDATE], "[m4_esyscmd([scripts/version.sh date | tr -d '\n'])]", [Last change date])
|
||||||
|
|
||||||
if test "${CC+set}" != set; then
|
if test "${CC+set}" != set; then
|
||||||
CC=gcc
|
CC=gcc
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -51,8 +51,6 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define PACKAGE_BUILDDATE (__DATE__ " " __TIME__)
|
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -18,4 +18,5 @@ EOF
|
||||||
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 PACKAGE_BUILDDATE "$(date)"
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [short|hash]"
|
echo "Usage: $0 [date|short|hash]"
|
||||||
echo
|
echo
|
||||||
echo "Determine the correct version number for the current build"
|
echo "Determine the correct version number for the current build"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -32,6 +32,7 @@ if [ -d "$TOPDIR/.git" ]; then
|
||||||
VER_SHORT="$VER_GIT_SHORT"
|
VER_SHORT="$VER_GIT_SHORT"
|
||||||
VER_HASH=$(git rev-parse --short HEAD)
|
VER_HASH=$(git rev-parse --short HEAD)
|
||||||
VER=$(git describe --abbrev=7 --dirty)
|
VER=$(git describe --abbrev=7 --dirty)
|
||||||
|
DATE=$(git log -1 --format=%cd)
|
||||||
else
|
else
|
||||||
# If there is no .git directory in our TOPDIR, we fall back on relying on
|
# If there is no .git directory in our TOPDIR, we fall back on relying on
|
||||||
# the VERSION file
|
# the VERSION file
|
||||||
|
@ -39,9 +40,13 @@ else
|
||||||
VER_SHORT="$VER_FILE_SHORT"
|
VER_SHORT="$VER_FILE_SHORT"
|
||||||
VER_HASH="HEAD"
|
VER_HASH="HEAD"
|
||||||
VER="$VER_FILE_SHORT"
|
VER="$VER_FILE_SHORT"
|
||||||
|
DATE=$(date)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
date)
|
||||||
|
echo "$DATE"
|
||||||
|
;;
|
||||||
hash)
|
hash)
|
||||||
echo "$VER_HASH"
|
echo "$VER_HASH"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user