Skip to content

Commit

Permalink
waf: copy the bootloaders instead of symlinking them
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator committed Nov 18, 2023
1 parent 6d32cb7 commit 5ebebf1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5ebebf1

Please sign in to comment.