summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2017-07-06 20:25:28 +0100
committerEric Engestrom <eric@engestrom.ch>2017-07-06 22:59:39 +0100
commit076faf8764d3cd8038145286f7533d0a18e82476 (patch)
treea7dc59a9fff663e8a06a11750e3a6f62b10950df /bin
parentbab03c06fc79ec5624982777684d0c5f123c127c (diff)
build systems: move git_sha1_gen.sh to bin/
There was no reason for this script to live outside the scripts directory. Suggested-by: Brian Paul <brianp@vmware.com> Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/git_sha1_gen.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/git_sha1_gen.sh b/bin/git_sha1_gen.sh
new file mode 100755
index 00000000000..898e5907587
--- /dev/null
+++ b/bin/git_sha1_gen.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# run git from the sources directory
+cd "$(dirname "$0")"
+
+# don't print anything if git fails
+if ! git_sha1=$(git --git-dir=../.git rev-parse --short=10 HEAD 2>/dev/null)
+then
+ exit
+fi
+
+printf '#define MESA_GIT_SHA1 "git-%s"\n' "$git_sha1"