[py] overwrite harfbuzz.cc only when there is a needed change
This commit is contained in:
parent
82c6ddb986
commit
1853f84abc
|
@ -12,7 +12,11 @@ if len (sys.argv) < 3:
|
||||||
output_file = sys.argv[1]
|
output_file = sys.argv[1]
|
||||||
source_paths = sys.argv[2:]
|
source_paths = sys.argv[2:]
|
||||||
|
|
||||||
with open (output_file, "wb") as f:
|
result = "".join ('#include "{}"\n'.format (x) for x in source_paths if x.endswith (".cc")).encode ()
|
||||||
f.write ("".join ('#include "{}"\n'.format (x)
|
|
||||||
for x in source_paths
|
with open (output_file, "rb") as f:
|
||||||
if x.endswith (".cc")).encode ())
|
current = f.read()
|
||||||
|
|
||||||
|
if result != current:
|
||||||
|
with open (output_file, "wb") as f:
|
||||||
|
f.write (result)
|
||||||
|
|
Loading…
Reference in New Issue