Add the git branch to the generated version.h file.

---
 src/Makefile.am |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index a5a6c6c..6d7eb2d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -95,17 +95,21 @@ endif
 via_driver.lo: version.h
 version.h: $(openchrome_drv_la_SOURCES)
        @if [ -d ../.git ]; then \
-           echo '#define BUILDCOMMENT "(developement build, at revision '\
-        "`git log -1 --pretty=format:%h | head -1`"')"' > [email protected]; \
-    else \
-        if [ -d .svn ]; then \
+               echo '#define BUILDCOMMENT "(developement build, branch' \
+                     "`git branch -v | sed 's/no branch/no_branch/' | \
+                      awk '/^\*/ { print $$2 }'`" \
+                     'at revision' \
+                     "`git log -1 --pretty=format:%h | head -1`"')"' \
+                    > [email protected]; \
+           else \
+               if [ -d .svn ]; then \
                echo '#define BUILDCOMMENT "(development build, at revision '\
                "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > [email protected]; \
-        else \
+               else \
                date +'#define BUILDCOMMENT "(development build, compiled on 
%c)"' \
-               > [email protected]; \
+                       > [email protected]; \
            fi; \
-    fi
+       fi
        @chmod 666 [email protected]
        @mv [email protected] $@
-- 
1.7.6.5

_______________________________________________
Openchrome-devel mailing list
[email protected]
http://wiki.openchrome.org/mailman/listinfo/openchrome-devel

Reply via email to