Fix topic generation logic for different board targets

This commit is contained in:
Lorenz Meier 2015-07-12 20:13:05 +02:00
parent 3c3abc078f
commit 9efc37a3ad
1 changed files with 12 additions and 12 deletions

View File

@ -149,6 +149,8 @@ def copy_changed(inputdir, outputdir, prefix=''):
shutil.copy(fni, fno)
print("{0}: new header file".format(f))
continue
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):
@ -156,7 +158,7 @@ def copy_changed(inputdir, outputdir, prefix=''):
print("{0}: updated".format(f))
continue
print("{0}: unchanged".format(f))
#print("{0}: unchanged".format(f))
def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
@ -165,11 +167,9 @@ def convert_dir_save(inputdir, outputdir, templatedir, temporarydir, prefix):
Unchanged existing files are not overwritten.
"""
# 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(temporarydir, outputdir, prefix)
else:
print('No changes.')
if __name__ == "__main__":
parser = argparse.ArgumentParser(