From: svnhieber Date: Thu, 2 Dec 2010 18:04:24 +0000 (+0000) Subject: always update svnrevision.h, also work with git svn X-Git-Url: https://git.rohieb.name/bachelor-thesis/roomba_tests.git/commitdiff_plain/0c7a3191b3ee11e1102f0bfe9b41912d95fbfffe always update svnrevision.h, also work with git svn git-svn-id: https://svn.itm.uni-luebeck.de/wisebed/wiselib/trunk/pc_apps/roomba_tests@3676 f8795833-4959-0410-8ae9-8bcb0cfab428 --- diff --git a/Makefile b/Makefile index 63e8b19..60ffab0 100644 --- a/Makefile +++ b/Makefile @@ -23,4 +23,5 @@ roomba_test: main.cc svnrevision.h battery_test: battery_test.cc $(CXX) $(CXXFLAGS) $< -o $@ +.PHONY: svnrevision.h # vim: noexpandtab : diff --git a/svnrevision.sh b/svnrevision.sh index 67b03a2..072d714 100755 --- a/svnrevision.sh +++ b/svnrevision.sh @@ -1,8 +1,16 @@ #!/bin/bash +if [ -d .svn ]; then + revision=$(svn info|grep Revision|sed 's/Revision: //') + stat=$(svn status|grep '^M') +elif [ -d .git/svn ]; then + revision=$(git svn info|grep Revision|sed 's/Revision: //') + stat=$(git status|grep 'modified: ') +else + echo No SVN working copy! + exit 1; +fi; -revision=$(svn info|grep Revision|sed 's/Revision: //') - -if [ -n "$(svn status|grep '^M')" ]; then +if [ -n "$stat" ]; then status=" with local changes" else status=""