mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update cef_api_hash.h at build time if necessary (fixes issue #2922)
The cef_api_hash.h file was previously only updated when the translator tool was run manually. Forgetting to run the translator tool after changing include/internal/cef_types*.h files would result in cef_parser.py incorrectly computing the CEF minor version number for future builds. By updating this file automatically at build time the number of errors should be reduced.
This commit is contained in:
@ -47,6 +47,19 @@ def path_exists(name):
|
||||
return os.path.exists(name)
|
||||
|
||||
|
||||
def write_file_if_changed(name, data):
|
||||
""" Write a file if the contents have changed. Returns True if the file was written. """
|
||||
if path_exists(name):
|
||||
old_contents = read_file(name)
|
||||
else:
|
||||
old_contents = ''
|
||||
|
||||
if (data != old_contents):
|
||||
write_file(name, data)
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def backup_file(name):
|
||||
""" Rename the file to a name that includes the current time stamp. """
|
||||
move_file(name, name + '.' + time.strftime('%Y-%m-%d-%H-%M-%S'))
|
||||
|
Reference in New Issue
Block a user