Author: hailfinger
Date: 2009-04-23 15:05:45 +0200 (Thu, 23 Apr 2009)
New Revision: 4194

Modified:
   trunk/coreboot-v2/src/config/Options.lb
Log:
This patch hooks up git mirrored svn revisions and adds some
error checking to the svnrevision call.

If a .svn directory exists in the top level directory and the svnversion
utility is available, we use svnversion.
Otherwise, if a .git directory exists in the top level directory and the
git utility is available, we use git log.

Signed-off-by: Carl-Daniel Hailfinger <[email protected]>
Acked-by: Myles Watson <[email protected]>


Modified: trunk/coreboot-v2/src/config/Options.lb
===================================================================
--- trunk/coreboot-v2/src/config/Options.lb     2009-04-23 03:59:33 UTC (rev 
4193)
+++ trunk/coreboot-v2/src/config/Options.lb     2009-04-23 13:05:45 UTC (rev 
4194)
@@ -96,8 +96,11 @@
        export always
        comment "Objcopy command"
 end
+
+# Try to determine svn revision first.
+# If that fails, try last svn revision in git log.
 define COREBOOT_VERSION
-       default "2.0.0-r$(shell if [ -f `which svnversion` ]; then svnversion 
$(TOP); fi)"
+       default "2.0.0-r$(shell if [ -d $(TOP)/.svn -a -f `which svnversion` ]; 
then svnversion $(TOP); else if [ -d $(TOP)/.git -a -f `which git` ]; then git 
--git-dir=/$(TOP)/.git log|grep git-svn-id|cut -f 2 -d@|cut -f 1 -d' '|sort 
-g|tail -1; fi; fi)"
        export always
        format "\"%s\""
        comment "coreboot version"


-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to