from __future__ import absolute_import
+import filecmp
import os
import sys
# Write out the library table.
make_install_dir(os.path.dirname(output_path))
- f = open(output_path, 'w')
+ f = open(output_path+'.new', 'w')
f.write("""\
//===- llvm-build generated file --------------------------------*- C++ -*-===//
//
f.write('};\n')
f.close()
+ if not os.path.isfile(output_path):
+ os.rename(output_path+'.new', output_path)
+ elif filecmp.cmp(output_path, output_path+'.new'):
+ os.remove(output_path+'.new')
+ else:
+ os.remove(output_path)
+ os.rename(output_path+'.new', output_path)
+
def get_required_libraries_for_component(self, ci, traverse_groups = False):
"""
get_required_libraries_for_component(component_info) -> iter