main/Makefile.am: fix code to generate version.h code is now als able to handle git...
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 10:15:19 +0000 (11:15 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 19 Nov 2009 10:15:19 +0000 (11:15 +0100)
main/Makefile.am

index a37289a..7c6c520 100644 (file)
@@ -27,7 +27,12 @@ entries: .svn/entries
 
 version.h: entries
        > version.h
 
 version.h: entries
        > version.h
-       if [ -d .svn ]; then echo "#define ENIGMA2_CHECKOUT_TAG \"D`svn info | grep 'Last Changed Date:' | sed -e 's/[^:]*: \(....\)-\(..\)-\(..\) \(..\):\(..\):\(..\).*+.*$$/\1.\2.\3.\4.\5.\6/'`\"" >> version.h; fi
+       @if [ -d .svn ]; then \
+               echo "#define ENIGMA2_LAST_CHANGE_DATE \"`LANG="en" svn info | grep 'Last Changed Date:' | cut -d' ' -f4`\"" >> version.h; \
+       elif [ -d ../.git ]; then \
+               echo "#define ENIGMA2_LAST_CHANGE_DATE \"`LANG="en" git log --max-count=1 --date=short | grep 'Date:' | cut -d' ' -f4`\"" >> version.h; \
+               echo "#define ENIGMA2_BRANCH \"`LANG="en" git branch | grep '* ' | cut -d' ' -f2`\"" >> version.h; \
+       fi;
 
 enigma2_LDADD_WHOLE = \
        $(top_builddir)/lib/actions/libenigma_actions.a \
 
 enigma2_LDADD_WHOLE = \
        $(top_builddir)/lib/actions/libenigma_actions.a \