From baf7e22edb788cf92642fc34892268368823ebaa Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 22 Mar 2019 16:24:27 -0400 Subject: oh-shlibdeps: Search RTLD paths with ldconfig --- diff --git a/src/oh-shlibdeps.sh b/src/oh-shlibdeps.sh index 8077166..7e2d594 100644 --- a/src/oh-shlibdeps.sh +++ b/src/oh-shlibdeps.sh @@ -21,20 +21,23 @@ . '@pkgdatadir@/load.sm' -LIBRARY_PATH='@library_path@' READELF_NEEDED_SED='s/^ 0x[0-9a-f]* (NEEDED) *Shared library: \[\(.*\)\]$/\1/p' find_lib() { local lib="${1}" shift 1 + local rtld_dirs= local pkg= local dir= + rtld_dirs="$(@LDCONFIG@ -v 2>/dev/null | \ + sed -n 's/^\([^\t].*\):$/\1/p')" + # Check just-built packages. for pkg in *.data/; do IFS=':' - for dir in ${LIBRARY_PATH}; do + for dir in ${rtld_dirs}; do unset IFS if [ -r "${pkg}/${dir}/${lib}" ]; then printf '%s,\n' "${pkg%.data/}" @@ -46,7 +49,7 @@ find_lib() # Check installed packages. IFS=':' - for dir in ${LIBRARY_PATH}; do + for dir in ${rtld_dirs}; do unset IFS if [ -r "${dir}/${lib}" ]; then lib="${dir}/${lib}" -- cgit v0.9.1