You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
694 B
28 lines
694 B
#!/usr/bin/env python2
|
|
|
|
import os
|
|
import sys
|
|
|
|
import version
|
|
|
|
version_string = '%s.%s.%s' % (version.major, version.minor, version.patch)
|
|
|
|
if len(sys.argv) < 2:
|
|
print sys.stderr, "Usage: %s <Version.inc.in>"
|
|
sys.exit(1)
|
|
|
|
with open(sys.argv[1], 'r') as f:
|
|
replacements = {
|
|
'@CLANG_VERSION@': version_string,
|
|
'@CLANG_VERSION_MAJOR@': version.major,
|
|
'@CLANG_VERSION_MINOR@': version.minor,
|
|
'@CLANG_VERSION_PATCHLEVEL@': version.patch,
|
|
'@CLANG_HAS_VERSION_PATCHLEVEL@': '1',
|
|
}
|
|
|
|
for line in f:
|
|
line = line.strip()
|
|
for replace, to in replacements.iteritems():
|
|
line = line.replace(replace, to)
|
|
print line
|