From 5ebebf14bba83eff08a5fda885a018a0dc38161a Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Sat, 18 Nov 2023 15:31:00 +1100 Subject: [PATCH] waf: copy the bootloaders instead of symlinking them --- wscript | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/wscript b/wscript index 6818574..0ede993 100644 --- a/wscript +++ b/wscript @@ -43,14 +43,11 @@ def copy_local_hwdef(): dirname, dirlist, filenames = next(os.walk('bootloaders')) for file in filenames: realpath = os.path.realpath(os.path.join(dirname, file)) - if os.path.islink(os.path.join('ardupilot/Tools/bootloaders', file)): - if os.path.realpath(os.path.join('ardupilot/Tools/bootloaders', file)) == realpath: - continue - else: - os.remove(os.path.join('ardupilot/Tools/bootloaders', file)) - elif os.path.isfile(os.path.join('ardupilot/Tools/bootloaders', file)): + # remove file if it exists + if os.path.isfile(os.path.join('ardupilot/Tools/bootloaders', file)): os.remove(os.path.join('ardupilot/Tools/bootloaders', file)) - os.symlink(realpath, os.path.join('ardupilot/Tools/bootloaders', file)) + # copy file + shutil.copy(realpath, os.path.join('ardupilot/Tools/bootloaders', file)) def options(opt): opt.parser.set_defaults(top='ardupilot')