From dacbdd6d534b0636a0b366a66041cc41e1318efc Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 26 Nov 2020 19:50:37 +0100 Subject: mkvenv: Search ldconfig in /sbin --- scripts/mkvenv.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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\S+) \((?P[^)]+)\) => (?P.*)') for line in ldconfig_proc.stdout.splitlines(): match = pattern.fullmatch(line.strip()) -- cgit v1.2.3-54-g00ecf