From c0d3cbf688f4192f5f742743399e0bdca3a1c932 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 13 May 2012 00:58:01 +0000 Subject: [PATCH] Make the use of blacklisted paths when building a OS X bundle a warning rather than an error Originally committed to SVN as r6770. --- aegisub/tools/osx-fix-libs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/aegisub/tools/osx-fix-libs.py b/aegisub/tools/osx-fix-libs.py index 1426ffffa..f0e276f75 100755 --- a/aegisub/tools/osx-fix-libs.py +++ b/aegisub/tools/osx-fix-libs.py @@ -10,6 +10,7 @@ is_bad_lib = re.compile(r'(/usr/local|/opt)').match is_sys_lib = re.compile(r'(/usr|/System)').match otool_libname_extract = re.compile(r'\s+(/.*?)[\(\s:]').search goodlist = [] +badlist = [] link_map = {} def otool(cmdline): @@ -27,8 +28,8 @@ def collectlibs(lib, masterlist, targetdir): lr = otool_libname_extract(l) if not lr: continue l = lr.group(1) - if is_bad_lib(l): - sys.exit("Linking with library in blacklisted location: " + l) + if is_bad_lib(l) and not l in badlist: + badlist.append(l) if not is_sys_lib(l) and not l in masterlist: locallist.append(l) print "found %s:" % l @@ -91,6 +92,12 @@ for lib in libs: os.system("%s -id '@executable_path/%s' '%s/%s'" % (in_tool_cmdline, libbase, targetdir, libbase)) sys.stdout.flush() +if badlist: + print + print "WARNING: The following libraries have blacklisted paths:" + for lib in sorted(badlist): + print lib + print "These paths normally have files from a package manager, which means that end result may not work if copied to another machine." print print "All done!"