]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/version.c.SH
Fix for "whats the color" 8ball question formats
[irc/evilnet/x3.git] / src / version.c.SH
index 8be88df58226323ff129325a25770137441d2e38..89f01fc2bdae69fbfc7a1a9f3655f9c449e5d5a3 100755 (executable)
@@ -1,14 +1,25 @@
 #! /bin/sh
 
+#TODO: we should tag our version changes, and use git describe instead of git log.
+
 echo "Extracting src/version.c ..."
 
-if test -f ../.release
-then
-        cvs_version=`cat ../.release`
+git_command='git describe'
+
+if [ -d ../.git ]; then
+    if [ -x `which git` ]; then
+        echo "Found git. version is"`$git_command`
+        cvs_version="git:"`$git_command`
+    else
+        echo "No git installed. unknown git revision"
+        cvs_version="git:unknown"
+    fi
 else
-        cvs_version=`hg tip --template '{rev}:{node|short} {date|shortdate}'`
+    echo "Not a git repository. leaving revision empty"
+    cvs_version="release"
 fi
 
+
 /bin/cat >version.c <<!SUB!THIS!
 /* version.c - CVS Version specific information.
  * Copyright 2000-2004 srvx Development Team