1 --- build/gen.py.orig 2019-10-24 18:38:23.121474871 +0200
2 +++ build/gen.py 2019-10-24 18:38:45.849743261 +0200
3 @@ -125,35 +125,7 @@
4
5
6 def GenerateLastCommitPosition(host, header):
7 - ROOT_TAG = 'initial-commit'
8 - describe_output = subprocess.check_output(
9 - ['git', 'describe', 'HEAD', '--match', ROOT_TAG], shell=host.is_windows(),
10 - cwd=REPO_ROOT)
11 - mo = re.match(ROOT_TAG + '-(\d+)-g([0-9a-f]+)', describe_output.decode())
12 - if not mo:
13 - raise ValueError(
14 - 'Unexpected output from git describe when generating version header')
15 -
16 - contents = '''// Generated by build/gen.py.
17 -
18 -#ifndef OUT_LAST_COMMIT_POSITION_H_
19 -#define OUT_LAST_COMMIT_POSITION_H_
20 -
21 -#define LAST_COMMIT_POSITION "%s (%s)"
22 -
23 -#endif // OUT_LAST_COMMIT_POSITION_H_
24 -''' % (mo.group(1), mo.group(2))
25 -
26 - # Only write/touch this file if the commit position has changed.
27 - old_contents = ''
28 - if os.path.isfile(header):
29 - with open(header, 'r') as f:
30 - old_contents = f.read()
31 -
32 - if old_contents != contents:
33 - with open(header, 'w') as f:
34 - f.write(contents)
35 -
36 + return 0
37
38 def WriteGenericNinja(path, static_libraries, executables,
39 cc, cxx, ar, ld, platform, host, options,
|