mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 913005 - Avoid overwriting unchanged stl_wrappers. r=ted
This commit is contained in:
parent
9bec3dacdd
commit
da1162a5e8
@ -113,7 +113,7 @@ STL_WRAPPERS_SENTINEL = $(DIST)/stl_wrappers/sentinel
|
||||
|
||||
$(STL_WRAPPERS_SENTINEL): $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS)
|
||||
$(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers
|
||||
$(PYTHON) $(srcdir)/nsinstall.py stl_wrappers $(DIST)
|
||||
$(PYTHON) $(srcdir)/nsinstall.py -t stl_wrappers $(DIST)
|
||||
touch $(STL_WRAPPERS_SENTINEL)
|
||||
|
||||
export:: $(STL_WRAPPERS_SENTINEL)
|
||||
|
@ -3,6 +3,7 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
from __future__ import print_function
|
||||
import os, re, string, sys
|
||||
from mozbuild.util import FileAvoidWrite
|
||||
|
||||
def find_in_path(file, searchpath):
|
||||
for dir in searchpath.split(os.pathsep):
|
||||
@ -37,13 +38,10 @@ def main(outdir, compiler, template_file, header_list_file):
|
||||
continue
|
||||
|
||||
path = header_path(header, compiler)
|
||||
try:
|
||||
f = open(os.path.join(outdir, header), 'w')
|
||||
with FileAvoidWrite(os.path.join(outdir, header)) as f:
|
||||
f.write(string.Template(template).substitute(HEADER=header,
|
||||
HEADER_PATH=path,
|
||||
NEW_HEADER_PATH=path_to_new))
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user