mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
Merge branch 'beta'
This commit is contained in:
@@ -155,14 +155,16 @@ def copy_changed(inputdir, outputdir, prefix=''):
|
|||||||
shutil.copy(fni, fno)
|
shutil.copy(fni, fno)
|
||||||
print("{0}: new header file".format(f))
|
print("{0}: new header file".format(f))
|
||||||
continue
|
continue
|
||||||
# The file exists in inputdir and outputdir
|
|
||||||
# only copy if contents do not match
|
|
||||||
if not filecmp.cmp(fni, fno):
|
|
||||||
shutil.copy(fni, fno)
|
|
||||||
print("{0}: updated".format(f))
|
|
||||||
continue
|
|
||||||
|
|
||||||
print("{0}: unchanged".format(f))
|
if os.path.getmtime(fni) > os.path.getmtime(fno):
|
||||||
|
# The file exists in inputdir and outputdir
|
||||||
|
# only copy if contents do not match
|
||||||
|
if not filecmp.cmp(fni, fno):
|
||||||
|
shutil.copy(fni, fno)
|
||||||
|
print("{0}: updated".format(f))
|
||||||
|
continue
|
||||||
|
|
||||||
|
#print("{0}: unchanged".format(f))
|
||||||
|
|
||||||
|
|
||||||
def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
||||||
@@ -171,11 +173,9 @@ def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
|
|||||||
Unchanged existing files are not overwritten.
|
Unchanged existing files are not overwritten.
|
||||||
"""
|
"""
|
||||||
# Create new headers in temporary output directory
|
# Create new headers in temporary output directory
|
||||||
if (convert_dir(inputdir, temporarydir, templatedir)):
|
convert_dir(inputdir, temporarydir, templatedir)
|
||||||
# Copy changed headers from temporary dir to output dir
|
# Copy changed headers from temporary dir to output dir
|
||||||
copy_changed(temporarydir, outputdir, prefix)
|
copy_changed(temporarydir, outputdir, prefix)
|
||||||
else:
|
|
||||||
print('No changes.')
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
|
|||||||
Reference in New Issue
Block a user