1
0
Fork 0

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
1 changed files with 5 additions and 0 deletions

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)