build-gem5: factor dtb copy with copy_dir_if_update_non_recursive

Less code, less boring + cp prints, only copy if modified.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-10-26 00:00:01 +00:00
parent 8f1c662e3d
commit bb1bb370a6
3 changed files with 6 additions and 5 deletions

View File

@@ -170,6 +170,7 @@ def write_string_to_file(path, string, mode='w'):
f.write(string)
def copy_dir_if_update_non_recursive(srcdir, destdir, filter_ext=None):
# TODO print rsync equivalent.
os.makedirs(destdir, exist_ok=True)
for basename in os.listdir(srcdir):
src = os.path.join(srcdir, basename)