diff --git a/plugins/pck-update.in b/plugins/pck-update.in index 9a3c505..29c2e88 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -2336,8 +2336,14 @@ build the list of the build requirements""${NORM}" solibpath_catch="" # is a shared library # req="libGL.so.1(libc6)" => /usr/lib/libGL.so - reqpath=$($path_ldconfig -Np | \ + reqpaths=$($path_ldconfig -Np | \ sed -n "s, ,,g;/${req/(*)/}/{s,.*=>,,;p}") + reqpath="" + for l in $reqpath; do + [ "${reqpath}" = "" ] && reqpath=$l + # Prefer solib in libdir path in case of multiple choices + [ "`dirname $l`" = "${libdir}" ] && { reqpath=$l; break; } + done solibpath="${reqpath/\.so\.*/.so}" notify.debug "\ req=\"$req\" ($reqpath) =?> solibpath=\"$solibpath\""