Make the use of blacklisted paths when building a OS X bundle a warning rather than an error

Originally committed to SVN as r6770.
This commit is contained in:
Thomas Goyne 2012-05-13 00:58:01 +00:00
parent deaf8669da
commit c0d3cbf688
1 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,7 @@ is_bad_lib = re.compile(r'(/usr/local|/opt)').match
is_sys_lib = re.compile(r'(/usr|/System)').match is_sys_lib = re.compile(r'(/usr|/System)').match
otool_libname_extract = re.compile(r'\s+(/.*?)[\(\s:]').search otool_libname_extract = re.compile(r'\s+(/.*?)[\(\s:]').search
goodlist = [] goodlist = []
badlist = []
link_map = {} link_map = {}
def otool(cmdline): def otool(cmdline):
@ -27,8 +28,8 @@ def collectlibs(lib, masterlist, targetdir):
lr = otool_libname_extract(l) lr = otool_libname_extract(l)
if not lr: continue if not lr: continue
l = lr.group(1) l = lr.group(1)
if is_bad_lib(l): if is_bad_lib(l) and not l in badlist:
sys.exit("Linking with library in blacklisted location: " + l) badlist.append(l)
if not is_sys_lib(l) and not l in masterlist: if not is_sys_lib(l) and not l in masterlist:
locallist.append(l) locallist.append(l)
print "found %s:" % 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)) os.system("%s -id '@executable_path/%s' '%s/%s'" % (in_tool_cmdline, libbase, targetdir, libbase))
sys.stdout.flush() 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
print "All done!" print "All done!"