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:50:37 +0100 |
commit | a0124e61d48613019b408585ae3da648c3f46c6a (patch) | |
tree | 252f539ec959414b7f09a35305b39aba4739f164 | |
parent | 7c1f177572daeb2063ab58b5669a4c3c02df6235 (diff) | |
download | qutebrowser-a0124e61d48613019b408585ae3da648c3f46c6a.tar.gz qutebrowser-a0124e61d48613019b408585ae3da648c3f46c6a.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 ad5f2073e..bfddff736 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: 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, encoding=sys.getfilesystemencoding(), ) + pattern = re.compile(r'(?P<name>\S+) \((?P<abi_type>[^)]+)\) => (?P<path>.*)') for line in ldconfig_proc.stdout.splitlines(): match = pattern.fullmatch(line.strip()) |