Added basic SVK support to version handling and changed the Makefile to
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 21 Sep 2007 22:07:38 +0000 (22:07 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 21 Sep 2007 22:07:38 +0000 (22:07 +0000)
issue a warning instead of error out when a version string cannot be
obtained.

git-svn-id: https://s.snth.net/svn/neverball/trunk@1144 78b8d119-cf0a-0410-b17c-f493084dd1d7

Makefile
scripts/version.sh

index be3987a..9e05b72 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 #-------------------------------------------------------------------------------
 
 VERSION := $(shell sh scripts/version.sh)
-ifeq ($(VERSION),)
-    $(error Failed to obtain version for this build)
+ifeq ($(VERSION),unknown)
+    $(warning Failed to obtain sane version for this build)
 endif
 
 #------------------------------------------------------------------------------
index e65e73b..3b1a8a2 100644 (file)
@@ -1,5 +1,18 @@
 #!/bin/sh
 
-rev=$(svnversion . /svn/neverball/trunk | tr : +)
-test -n "$rev" && test "$rev" != "exported" && echo "dev-r${rev}"
+LC_ALL=C
+export LC_ALL
+
+svn_version() {
+    svn_rev="$(svnversion . /svn/neverball/trunk | tr : +)"
+    test "$svn_rev" != "exported" && echo "$svn_rev"
+}
+
+svk_version() {
+    svk info 2> /dev/null | grep -E "^Mirrored From:" |
+    sed -e "s/^[^,]*, Rev\. //"
+}
+
+rev="$(svn_version || svk_version)"
+test -n "$rev" && echo "dev-r$rev" || echo "unknown"