forked from mia/Aegisub
parent
f501567e2d
commit
839dcc5aed
1 changed files with 9 additions and 3 deletions
|
@ -10,6 +10,7 @@ import subprocess
|
||||||
is_bad_lib = re.compile(r'(/usr/local|/opt)').match
|
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
|
||||||
|
otool_loader_path_extract = re.compile(r'\s+@loader_path/(.*?)[(\s:]').search
|
||||||
goodlist = []
|
goodlist = []
|
||||||
badlist = []
|
badlist = []
|
||||||
link_map = {}
|
link_map = {}
|
||||||
|
@ -28,9 +29,14 @@ def collectlibs(lib, masterlist, targetdir):
|
||||||
|
|
||||||
for l in liblist:
|
for l in liblist:
|
||||||
lr = otool_libname_extract(l)
|
lr = otool_libname_extract(l)
|
||||||
if not lr:
|
if lr:
|
||||||
continue
|
l = lr.group(1)
|
||||||
l = lr.group(1)
|
else:
|
||||||
|
lr = otool_loader_path_extract(l)
|
||||||
|
if lr:
|
||||||
|
l = os.path.join(os.path.dirname(lib), lr.group(1))
|
||||||
|
else:
|
||||||
|
continue
|
||||||
if is_bad_lib(l) and l not in badlist:
|
if is_bad_lib(l) and l not in badlist:
|
||||||
badlist.append(l)
|
badlist.append(l)
|
||||||
if ((not is_sys_lib(l)) or is_bad_lib(l)) and l not in masterlist:
|
if ((not is_sys_lib(l)) or is_bad_lib(l)) and l not in masterlist:
|
||||||
|
|
Loading…
Reference in a new issue