Another year is about to end... So we have to update these damn copyright information :P
[NeonServV5.git] / src / version.sh
index 50383ce4e973621838e4d90944aa2dfff73faccb..2cdc0f42c8ba106b0be15b43353430ac429a0b33 100644 (file)
@@ -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,8 +35,8 @@ fi
 
 
 /bin/cat > version.c <<!SUB!THIS!
-/* version.c - NeonServ v5.0
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* version.c - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -59,5 +60,7 @@ const char *creation = "$creation";
 const char *revision = "$svn_revision";
 const char *codelines = "$codelines";
 
+const int patchlevel = ($git_commitcount ? ($git_commitcount - VERSION_PATCHLEVEL) : 0);
+
 !SUB!THIS!