add support for .git/last_commit_info generated by bitbake with latest "hack" 3.0.3
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 16 Dec 2010 00:21:10 +0000 (01:21 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Thu, 16 Dec 2010 00:21:10 +0000 (01:21 +0100)
main/Makefile.am

index 4f26387e09cbd7f8063e9259acf3b3160f19e679..975432c51f898d86f71a2eacf6bc455db252975a 100644 (file)
@@ -31,11 +31,15 @@ version.h: entries
                echo "#define ENIGMA2_LAST_CHANGE_DATE \"`LANG="en" svn info | grep 'Last Changed Date:' | cut -d' ' -f4`\"" >> version.h; \
        elif [ -d ../.git ]; then \
                if [ -f ../.git/last_commit_info ]; then \
-                       echo "#define ENIGMA2_LAST_CHANGE_DATE \"`cat ../.git/last_commit_info | grep 'Date:' | cut -d' ' -f4`\"" >> version.h; \
+                       LAST_CHANGE_DATE=`cat ../.git/last_commit_info | grep 'CommitDate:' | cut -d' ' -f2`; \
+                       if [ "$$LAST_CHANGE_DATE" = "" ]; then \
+                               LAST_CHANGE_DATE=`cat ../.git/last_commit_info | grep 'Date:' | cut -d' ' -f4`; \
+                       fi; \
+                       echo "#define ENIGMA2_LAST_CHANGE_DATE \"$$LAST_CHANGE_DATE\"" >> version.h; \
                        echo "#define ENIGMA2_BRANCH \"`cat ../.git/branch`\"" >> version.h; \
                else \
-                       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; \
+                       echo "#define ENIGMA2_LAST_CHANGE_DATE \"`LANG="en" git log --pretty=fuller --max-count=1 --date=short | grep 'CommitDate:' | cut -d' ' -f2`\"" >> version.h; \
+                       echo "#define ENIGMA2_BRANCH \"`LANG=\"en\" git branch | grep '* ' | cut -d' ' -f2`\"" >> version.h; \
                fi; \
        fi;