From 5bde34ff3e8b41377be5cb24b112d29d49c5f306 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Fri, 1 Jul 2022 23:25:16 +0200 Subject: [PATCH] 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. --- tools/osx-fix-libs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/osx-fix-libs.py b/tools/osx-fix-libs.py index e29c8180f..d853e20ee 100755 --- a/tools/osx-fix-libs.py +++ b/tools/osx-fix-libs.py @@ -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)