From a3a615fa7f4b4216259850d0276db54075ff0b49 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 2 Jun 2015 22:24:28 -0700 Subject: [PATCH] Tools: Make deploy-mac work with symlinks --- tools/deploy-mac.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/deploy-mac.py b/tools/deploy-mac.py index d5446599a..3e648099f 100755 --- a/tools/deploy-mac.py +++ b/tools/deploy-mac.py @@ -67,6 +67,15 @@ def parseOtoolLine(line, execPath, root): split[:1] = execPath if split[0] == '/' and not os.access(joinPath(split), os.F_OK): split[:1] = root + try: + oldPath = joinPath(split) + while True: + linkPath = os.readlink(os.path.abspath(oldPath)) + oldPath = os.path.join(os.path.dirname(oldPath), linkPath) + except OSError as e: + if e.errno != errno.EINVAL: + raise + split = splitPath(oldPath) isFramework = False if not split[-1].endswith('.dylib'): isFramework = True