1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

gn build: Fix a Python2ism in write_vcsrevision.py.

Convert the output of "git rev-parse --short HEAD" to a string before
substituting it into the output file. Without this the output file
will look like this on Python 3:

 #define LLVM_REVISION "git-b'6a4895a025f'"

Differential Revision: https://reviews.llvm.org/D56459

llvm-svn: 350686
This commit is contained in:
Peter Collingbourne 2019-01-09 04:05:07 +00:00
parent d73a79a1e0
commit 15d0ad0568

View File

@ -52,9 +52,9 @@ def main():
git = which('git.bat')
use_shell = True
rev = subprocess.check_output([git, 'rev-parse', '--short', 'HEAD'],
cwd=git_dir, shell=use_shell)
cwd=git_dir, shell=use_shell).decode().strip()
# FIXME: add pizzas such as the svn revision read off a git note?
vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev.strip()
vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev
# If the output already exists and is identical to what we'd write,
# return to not perturb the existing file's timestamp.