1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
10 parentdir
= os
.path
.abspath(os
.path
.join(output
, os
.pardir
))
12 #The original body of this file is generated by this bash script:
14 #touch "${DIR}/git_sha1.h.tmp"
15 #if test -d .git; then \
16 # if which git > /dev/null; then \
17 # git log -n 1 --oneline | \
18 # sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
19 # > "${DIR}/git_sha1.h.tmp" ; \
22 #if ! cmp -s "${DIR}/git_sha1.h.tmp" "${DIR}/git_sha1.h"; then \
23 # mv "${DIR}/git_sha1.h.tmp" "${DIR}/git_sha1.h" ;\
25 # rm "${DIR}/git_sha1.h.tmp" ;\
28 #However, Chromium shouldn't depend on Bash, and this preprocessor macro isn't
29 #neccessary in the first place
31 if not os
.path
.isdir(parentdir
):
32 os
.makedirs(parentdir
)
34 with
open(output
, "w") as f
: