Revert r88639 (the optimization changes behaviour and breaks buildbots)

This commit is contained in:
Antoine Pitrou 2011-02-26 09:37:45 +00:00
parent ffa1a77c67
commit 09c530dfc8
4 changed files with 7 additions and 22 deletions

View file

@ -203,18 +203,14 @@ def _findSoname_ldconfig(name):
abi_type = mach_map.get(machine, 'libc6')
# XXX assuming GLIBC's ldconfig (with option -p)
name = 'lib%s' % name
pat = re.compile('\s*(/[^\(\)\s]*%s\.[^\(\)\s]*)' % re.escape(name))
expr = r'(\S+)\s+\((%s(?:, OS ABI:[^\)]*)?)\)[^/]*(/[^\(\)\s]*lib%s\.[^\(\)\s]*)' \
% (abi_type, re.escape(name))
with contextlib.closing(os.popen('LC_ALL=C LANG=C /sbin/ldconfig -p 2>/dev/null')) as f:
for line in f:
if not '=>' in line:
continue
path = line.rsplit('=>', 1)[1]
if not name+'.' in path:
continue
res = pat.search(path)
if res:
return res.group(1)
data = f.read()
res = re.search(expr, data)
if not res:
return None
return res.group(1)
def find_library(name):
return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))