[Intel-gfx] [PATCH] igt/build: Do not fail git build when there is no git

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Mon Jul 21 14:28:07 CEST 2014


Git detection probably belongs to configure.ac with the version.h
rule reworked accordingly. Feel free to drop this if someone
wants to spend time on a better fix.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 Makefile.am | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 9949679..7b04d6f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,9 +41,11 @@ MAINTAINERCLEANFILES = ChangeLog INSTALL
 version.h.tmp:
 	@touch $@
 	@if test -d .git; then \
-		if which git > /dev/null; then git log -n 1 --oneline | \
+		if which git > /dev/null 2>&1; then git log -n 1 --oneline | \
 			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
 			>> $@ ; \
+		else \
+			echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
 		fi \
 	else \
 		echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
-- 
1.9.1




More information about the Intel-gfx mailing list