diff options
author | Kinsey Moore <kinsey.moore@oarcorp.com> | 2022-08-24 13:22:12 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2022-08-26 09:05:26 -0500 |
commit | 20dd29f6422226d0918e138ab10232a1f777bad7 (patch) | |
tree | c900e3dcbaa19164c802942cd9851b42bc6119cb | |
parent | lwip.py: Support Python earlier than 3.9 (diff) | |
download | rtems-lwip-20dd29f6422226d0918e138ab10232a1f777bad7.tar.bz2 |
lwip-to-rtems.py: Add support for reverse changes
This adds the necessary support for moving changes back and forth to the
upstream repository.
-rwxr-xr-x | lwip-to-rtems.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lwip-to-rtems.py b/lwip-to-rtems.py index acd6922..1be2628 100755 --- a/lwip-to-rtems.py +++ b/lwip-to-rtems.py @@ -86,8 +86,8 @@ print("Direction: %s" % (("reverse", "forward")[isForward])) def copyFiles(isforward): + files = json.load(open('file-import.json', 'r')) if (isforward): - files = json.load(open('file-import.json', 'r')) src_dir = os.path.abspath(LWIP_UPSTREAM_DIR) print("Files Imported:") for f in files['files-to-import']: @@ -95,10 +95,14 @@ def copyFiles(isforward): dst_file = os.path.join(dst_dir, f.split('/')[-1]) if not os.path.exists(dst_dir): os.makedirs(dst_dir) - if not os.path.exists(dst_file): - Path(dst_file).touch() - print(dst_file) - copyfile(str(os.path.join(src_dir, f)), - str(dst_file)) + Path(dst_file).touch() + print(dst_file) + copyfile(str(os.path.join(src_dir, f)), + str(dst_file)) + else: + for f in files['files-to-import']: + src_file = os.path.join(os.path.abspath(LWIP_DIR), f) + dst_file = os.path.join(os.path.abspath(LWIP_UPSTREAM_DIR), f) + copyfile(str(src_file), str(dst_file)) copyFiles(isForward) |