Find so in `ldconfig -p`. It does not handle LD_LIBRARY_PATH.
(name)
| 286 | return os.path.realpath(res) |
| 287 | |
| 288 | def _use_ldconfig(name): |
| 289 | """ |
| 290 | Find so in `ldconfig -p`. |
| 291 | It does not handle LD_LIBRARY_PATH. |
| 292 | """ |
| 293 | with change_env('LC_ALL', 'C'), change_env('LANG', 'C'): |
| 294 | ldconfig, ret = subproc_call("ldconfig -p") |
| 295 | ldconfig = ldconfig.decode('utf-8') |
| 296 | if ret != 0: |
| 297 | return None |
| 298 | expr = r'\s+(lib%s\.[^\s]+)\s+\(.*=>\s+(.*)' % (re.escape(name)) |
| 299 | res = re.search(expr, ldconfig) |
| 300 | if not res: |
| 301 | return None |
| 302 | else: |
| 303 | ret = res.group(2) |
| 304 | return os.path.realpath(ret) |
| 305 | |
| 306 | if sys.platform.startswith('linux'): |
| 307 | return _use_proc_maps(name) or _use_ld(name) or _use_ldconfig(name) or find_library(name) |
no test coverage detected