2 if [ ! -f src
/mesa
/main
/git_sha1.h
]; then
3 touch src
/mesa
/main
/git_sha1.h
10 if which git
> /dev
/null
; then
11 # Extract the 7-digit "short" SHA1 for the current HEAD, convert
12 # it to a string, and wrap it in a #define. This is used in
13 # src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
14 git log
-n 1 --oneline |\
15 sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
16 > src
/mesa
/main
/git_sha1.h.tmp
17 if ! cmp -s src
/mesa
/main
/git_sha1.h.tmp src
/mesa
/main
/git_sha1.h
; then
18 mv src
/mesa
/main
/git_sha1.h.tmp src
/mesa
/main
/git_sha1.h