auto-extract repo revs from svn or git as needed - closes issue #5

This commit is contained in:
Michael Iedema 2014-06-20 20:09:47 +02:00
parent 6608dcd6df
commit a53ff24605
3 changed files with 14 additions and 3 deletions

View File

@ -20,4 +20,4 @@
#include "config.h"
#include <Globals.h>
const char *gVersionString = "release " VERSION " built " TIMESTAMP_ISO " rev" SVN_REV " ";
const char *gVersionString = "release " VERSION " built " TIMESTAMP_ISO " " REPO_REV " ";

11
Globals/GrabRepoInfo.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
cd $1
INFO=""
if [ -d ./.svn ]; then
INFO="r$(svn info . | grep "Last Changed Rev:" | cut -d " " -f 4) CommonLibs:r$(svn info ./CommonLibs | grep "Last Changed Rev:" | cut -d " " -f 4)"
elif [ -d ./.git ]; then
INFO="$(git rev-parse --short=10 HEAD) CommonLibs:$(cd CommonLibs; git rev-parse --short=10 HEAD)"
fi
echo $INFO

View File

@ -30,10 +30,10 @@ SR_INCLUDEDIR = $(top_srcdir)/SR
NODEMANAGER_INCLUDEDIR = $(top_srcdir)/NodeManager
JSONBOX_INCLUDEDIR = $(top_srcdir)/NodeManager/JsonBox-0.4.3/include
SVNDEV = -D'SVN_REV="$(shell svn info $(top_builddir) | grep "Last Changed Rev:" | cut -d " " -f 4) CommonLibs:rev$(shell svn info $(top_builddir)/CommonLibs | grep "Last Changed Rev:" | cut -d " " -f 4)"'
REPOREV = -D'REPO_REV="$(shell ./$(top_builddir)/Globals/GrabRepoInfo.sh $(top_builddir))"'
STD_DEFINES_AND_INCLUDES = \
$(SVNDEV) \
$(REPOREV) \
-DSR_API_ONLY \
-I$(COMMON_INCLUDEDIR) \
-I$(GSM_INCLUDEDIR) \