Bug 913005 - Avoid overwriting unchanged stl_wrappers. r=ted

This commit is contained in:
Mike Hommey 2013-09-06 09:22:39 +09:00
parent 9bec3dacdd
commit da1162a5e8
2 changed files with 3 additions and 5 deletions

View File

@ -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)

View File

@ -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__':