aboutsummaryrefslogtreecommitdiff
path: root/mesalib/bin
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-05-06 06:13:52 +0000
committermarha <marha@users.sourceforge.net>2011-05-06 06:13:52 +0000
commitc721bc9b176ec37d8b80a92c89840658f8f6c458 (patch)
treedc287f9829cd40b0a7e6643c120315224572b0fd /mesalib/bin
parent4ac3e6a0be77b6fd4642a3c4df67590cb645ee7e (diff)
parent151019725213fc50a8aa4db8c4524387fea8f476 (diff)
downloadvcxsrv-c721bc9b176ec37d8b80a92c89840658f8f6c458.tar.gz
vcxsrv-c721bc9b176ec37d8b80a92c89840658f8f6c458.tar.bz2
vcxsrv-c721bc9b176ec37d8b80a92c89840658f8f6c458.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/bin')
-rw-r--r--mesalib/bin/extract_git_sha114
1 files changed, 12 insertions, 2 deletions
diff --git a/mesalib/bin/extract_git_sha1 b/mesalib/bin/extract_git_sha1
index cf3006f8f..c2994ff09 100644
--- a/mesalib/bin/extract_git_sha1
+++ b/mesalib/bin/extract_git_sha1
@@ -1,10 +1,20 @@
#!/bin/sh
-touch src/mesa/main/git_sha1.h
+if [ ! -f src/mesa/main/git_sha1.h ]; then
+ touch src/mesa/main/git_sha1.h
+fi
+
+if [ ! -d .git ]; then
+ exit
+fi
+
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
- > src/mesa/main/git_sha1.h
+ > src/mesa/main/git_sha1.h.tmp
+ if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
+ mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
+ fi
fi