diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-11-26 19:50:37 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-11-26 19:51:03 +0100 |
commit | dacbdd6d534b0636a0b366a66041cc41e1318efc (patch) | |
tree | eb1b187a8ee53b0454fdde46cc12ce5951e0d91b | |
parent | c0f210f0141f65aed5940881289972bf9566ca4a (diff) | |
download | qutebrowser-dacbdd6d534b0636a0b366a66041cc41e1318efc.tar.gz qutebrowser-dacbdd6d534b0636a0b366a66041cc41e1318efc.zip |
mkvenv: Search ldconfig in /sbin
-rw-r--r-- | scripts/mkvenv.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/mkvenv.py b/scripts/mkvenv.py index 8fb1c9b46..191d3c6ac 100644 --- a/scripts/mkvenv.py +++ b/scripts/mkvenv.py @@ -296,12 +296,19 @@ def apply_xcb_util_workaround( def _find_libs() -> Dict[Tuple[str, str], List[str]]: """Find all system-wide .so libraries.""" all_libs = {} # type: Dict[Tuple[str, str], List[str]] + + if pathlib.Path("/sbin/ldconfig").exists(): + # /sbin might not be in PATH on e.g. Debian + ldconfig_bin = "/sbin/ldconfig" + else: + ldconfig_bin = "ldconfig" ldconfig_proc = subprocess.run( - ['ldconfig', '-p'], + [ldconfig_bin, '-p'], check=True, stdout=subprocess.PIPE, universal_newlines=True, ) + pattern = re.compile(r'(?P<name>\S+) \((?P<abi_type>[^)]+)\) => (?P<path>.*)') for line in ldconfig_proc.stdout.splitlines(): match = pattern.fullmatch(line.strip()) |