summaryrefslogtreecommitdiffstats
path: root/third_party/mesa/generate_git_sha1.py
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 00:51:58 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 00:51:58 +0000
commita5ee3a15a4f05761685312f4bf268e80a8e65234 (patch)
treea1e66ccc3bb0c778d964b2031f4f8dae11b62640 /third_party/mesa/generate_git_sha1.py
parent88492920be635949ea22dfb2a24f33eb71fc03c3 (diff)
downloadchromium_src-a5ee3a15a4f05761685312f4bf268e80a8e65234.zip
chromium_src-a5ee3a15a4f05761685312f4bf268e80a8e65234.tar.gz
chromium_src-a5ee3a15a4f05761685312f4bf268e80a8e65234.tar.bz2
Upgrading Mesa to 9.0.3.
Patch landed on behalf of mymax@amazon.com. OWNERS approvals are in https://chromiumcodereview.appspot.com/17005007/ . Try jobs (w/o binaries) are in https://chromiumcodereview.appspot.com/17422003/ . TBR=kbr@chromium.org BUG=238755 Review URL: https://codereview.chromium.org/17341003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mesa/generate_git_sha1.py')
-rw-r--r--third_party/mesa/generate_git_sha1.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/third_party/mesa/generate_git_sha1.py b/third_party/mesa/generate_git_sha1.py
new file mode 100644
index 0000000..c50e871
--- /dev/null
+++ b/third_party/mesa/generate_git_sha1.py
@@ -0,0 +1,31 @@
+import os
+import os.path
+import sys
+
+output = sys.argv[1]
+parentdir = os.path.abspath(os.path.join(output, os.pardir))
+
+#The original body of this file is generated by this bash script:
+#
+#touch "${DIR}/git_sha1.h.tmp"
+#if test -d .git; then \
+# if which git > /dev/null; then \
+# git log -n 1 --oneline | \
+# sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
+# > "${DIR}/git_sha1.h.tmp" ; \
+# fi \
+# fi
+#if ! cmp -s "${DIR}/git_sha1.h.tmp" "${DIR}/git_sha1.h"; then \
+# mv "${DIR}/git_sha1.h.tmp" "${DIR}/git_sha1.h" ;\
+# else \
+# rm "${DIR}/git_sha1.h.tmp" ;\
+# fi
+#
+#However, Chromium shouldn't depend on Bash, and this preprocessor macro isn't
+#neccessary in the first place
+
+if not os.path.isdir(parentdir):
+ os.makedirs(parentdir)
+
+with open(output, "w") as f:
+ pass