Mesa (10.6): mesa: Fix generation of git_sha1.h.tmp for gitlinks

Emil Velikov evelikov at kemper.freedesktop.org
Thu Jul 23 11:36:46 UTC 2015


Module: Mesa
Branch: 10.6
Commit: 9c7f5947058b17d2fd117e475a0395a6a1f745af
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9c7f5947058b17d2fd117e475a0395a6a1f745af

Author: Chad Versace <chad.versace at intel.com>
Date:   Thu Jul  9 18:46:21 2015 -0700

mesa: Fix generation of git_sha1.h.tmp for gitlinks

Don't assume that $(top_srcdir)/.git is a directory. It may be a
gitlink file [1] if $(top_srcdir) is a submodule checkout or a linked
worktree [2].

[1] A "gitlink" is a text file that specifies the real location of
    the gitdir.
[2] Linked worktrees are a new feature in Git 2.5.

Cc: "10.6, 10.5" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
(cherry picked from commit 75784243df1f5bb0652fb243b37d69f36d493a86)

---

 src/mesa/Makefile.am |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 71794b5..4ba5b2f 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -40,8 +40,11 @@ gl_HEADERS = $(top_srcdir)/include/GL/*.h
 
 .PHONY: main/git_sha1.h.tmp
 main/git_sha1.h.tmp:
+	@# Don't assume that $(top_srcdir)/.git is a directory. It may be
+	@# a gitlink file if $(top_srcdir) is a submodule checkout or a linked
+	@# worktree.
 	@touch main/git_sha1.h.tmp
-	@if test -d $(top_srcdir)/.git; then \
+	@if test -e $(top_srcdir)/.git; then \
 		if which git > /dev/null; then \
 		    git --git-dir=$(top_srcdir)/.git log -n 1 --oneline | \
 			sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \




More information about the mesa-commit mailing list