Skip to content

Commit

Permalink
Bug 913005 - Avoid overwriting unchanged stl_wrappers. r=ted
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Sep 6, 2013
1 parent 9bec3da commit da1162a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/Makefile.in
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions config/make-stl-wrappers.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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__':
Expand Down

0 comments on commit da1162a

Please sign in to comment.