if printf '%s\n' "${arch[@]}" | grep -qvxF any; then if ! _errors=$( diff <( { find "${pkgdir}" -type f -exec objdump -x {} \; 2>/dev/null \ | sed ' s/^\s*NEEDED\s\+\(\S\+\.so\)\(\.\S\+\)\?\s*$/\1/ t d ' \ | sort -u \ | while read -r _lib; do for _libdir in {${pkgdir},}/usr/lib*; do [ -d "${_libdir}" ] || continue [ -e "${_libdir}/${_lib}" ] \ && printf '%s\n' "${_lib}" done done \ | sort -u for _libdir in "${pkgdir}/usr"/lib*; do [ -d "${_libdir}" ] || continue find "${_libdir}" -not -type d -name '*.so' -printf '%f\n%f\n' done } \ | sort \ | uniq -u \ | while read -r _lib; do if ! _pkg=$( pacman -Qqo "/usr/lib/${_lib}" 2>/dev/null ); then >&2 printf 'WARNING: noone owns "%s"\n' "${_lib}" printf '%s\n' "${_lib}" continue fi if pacman -Qi "${_pkg}" \ | sed ' :a $! N s/\n\s\+/ / ta P D ' \ | sed -n ' s/^Provides\s*:\s*// T y/ /\n/ p ' \ | sed -n ' /^$/d s/=.*$// T /\.so$/p ' \ | grep -qxF "${_lib}"; then printf '%s\n' "${_lib}" else printf '%s\n' "${_pkg}" fi done \ | sed ' s/[<>]\?=.*$// /^python$/d /^$/d ' \ | sort -u ) <( eval 'printf '"'"'%s\n'"'"' "${_pinned_dependencies[@]}" "${_pinned_dependencies_'"${CARCH}"'[@]}" "${_pinned_dependencies_'"${OS}"'[@]}"' \ | sed ' s/[<>]\?=.*$// /^python$/d /^$/d ' \ | sort -u ) ); then { printf 'There are discrepancies between the _pinned_dependencies and the linked libraries in %s'"'"'s %s():\n' \ "${pkgbase:-${pkgname}}" \ "${FUNCNAME[1]}" printf '%s\n' "${_errors}" \ | sed ' s/^/claimed / t d ' \ | sort -k1,1 } \ | tee -a /tmp/pin-dependencies.log return 1 fi fi