Changeset 280590 in webkit
- Timestamp:
- Aug 3, 2021, 6:26:20 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
glib/apply-build-revision-to-files.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r280576 r280590 1 2021-08-03 Philippe Normand <pnormand@igalia.com> 2 3 [WPE][GTK] SVN_REVISION drifting away if bots don't re-run cmake 4 https://bugs.webkit.org/show_bug.cgi?id=228290 5 6 Reviewed by Michael Catanzaro. 7 8 The apply-build-revision-to-files.py script wasn't expanding the BUILD_REVISION beyond the 9 first run, because it processes files generated by CMake already, and expanding the 10 BUILD_REVISION once prevents further expansions. So the proposed solution is to always 11 expand BuildRevision.h.in from that script, and for .pc files, to restore the BUILD_REVISION 12 template before updating the file. 13 14 * glib/apply-build-revision-to-files.py: 15 (main): 16 1 17 2021-08-02 Peng Liu <peng.liu6@apple.com> 2 18 -
trunk/Tools/glib/apply-build-revision-to-files.py
r280466 r280590 27 27 from webkitpy.common.system.filesystem import FileSystem # nopep8 28 28 29 30 29 def main(args): 31 30 scm = SCMDetector(FileSystem(), Executive()).default_scm() … … 34 33 35 34 for in_file in args: 36 with open(in_file) as fd: 37 data = fd.read().replace('${BUILD_REVISION}', build_revision) 35 filename = os.path.basename(in_file) 36 _, extension = os.path.splitext(filename) 37 if filename == "BuildRevision.h": 38 with open("Source/WebKit/Shared/glib/BuildRevision.h.in") as template: 39 data = template.read() 40 elif extension == '.pc': 41 # Restore a valid BUILD_REVISION template. 42 lines = [] 43 with open(in_file) as fd: 44 for line in fd.readlines(): 45 if line.startswith("revision"): 46 line = "revision=${BUILD_REVISION}\n" 47 lines.append(line) 48 data = "".join(lines) 49 else: 50 print("Support for expanding $BUILD_REVISION in {} is missing.".format(in_file)) 51 return 1 52 38 53 with open(in_file, 'w') as fd: 39 fd.write(data )54 fd.write(data.replace('${BUILD_REVISION}', build_revision)) 40 55 41 56 return 0
Note:
See TracChangeset
for help on using the changeset viewer.