X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fversion.sh;h=07142bbeac868f4559ea175009cc0934e5b245ba;hb=689da1db7e2517c187ce76c6c553e20d630a7f36;hp=b5bdc125ea49474948a0faa7a59989909aeb3b7b;hpb=0f1dc61921eef1db8e404a5a82372e2d1cd55daa;p=NeonServV5.git diff --git a/src/version.sh b/src/version.sh index b5bdc12..07142bb 100644 --- a/src/version.sh +++ b/src/version.sh @@ -20,12 +20,13 @@ else \ codelines=`find . -type f -regex '\./.*\.h' -or -regex '\./.*\.c' |xargs cat|wc -l` svn_revision=`svn info | grep Revision | grep -o -E '[0-9]+'` +git_commitcount=0 if test "x$svn_revision" = "x" ; then svn_revision=`git log -n 1 --pretty="format:%h"` if test "x$svn_revision" = "x" ; then svn_revision="0" else - git_commitcount=`git rev-list --all --no-merges | wc -l | sed "s/[ \t]//g"` + git_commitcount=`git log --pretty=oneline --no-merges --first-parent | wc -l | sed "s/[ \t]//g"` svn_revision="git-$git_commitcount-$svn_revision" fi else @@ -34,6 +35,22 @@ fi /bin/cat > version.c <. + */ //Auto generated file! #include "version.h" @@ -43,5 +60,27 @@ const char *creation = "$creation"; const char *revision = "$svn_revision"; const char *codelines = "$codelines"; +const int patchlevel = ($git_commitcount ? ($git_commitcount - VERSION_PATCHLEVEL) : 0); + +const char *get_compilation() { + return compilation; +} + +const char *get_creation() { + return creation; +} + +const char *get_revision() { + return revision; +} + +const char *get_codelines() { + return codelines; +} + +const int get_patchlevel() { + return patchlevel; +} + !SUB!THIS!