macos: attempt to fix the installer build

Try and fix an issue when a symlink would link to a path with the same
basename, without actually having a mac system available to test.
This commit is contained in:
arch1t3cht 2022-07-01 23:25:16 +02:00 committed by Ryan Lucia
parent 2bf4f17e58
commit 5bde34ff3e

View file

@ -49,6 +49,11 @@ def collectlibs(lib, masterlist, targetdir):
basename = os.path.basename(check)
target = os.path.join(targetdir, basename)
if os.path.islink(target):
# If a library was a symlink to a file with the same name in another directory,
# this could otherwise cause a FileNotFoundError
os.remove(target)
if os.path.isfile(check) and not os.path.islink(check):
try:
shutil.copy(check, target)