From 5baa57a65368472c2c22b9bd2b30e634ef644b92 Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Tue, 5 Feb 2008 18:57:08 +0000 Subject: [PATCH] don't record internal providers in NEEDED records as they are pointless for all useful applications in portage and complicate them instead (e.g. bug #205531) svn path=/main/trunk/; revision=9275 --- bin/misc-functions.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 7857ef28a..909509997 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -158,8 +158,27 @@ install_qa_check() { sleep 1 fi - # Save NEEDED information - scanelf -qyRF '%p %n' "${D}" | sed -e 's:^:/:' > "${PORTAGE_BUILDDIR}"/build-info/NEEDED + # Save NEEDED information after removing self-contained providers + scanelf -qyRF '%p:%r %n' "${D}" | sed -e 's:^:/:' | { while read l; do + obj=${l%%:*} + rpath=${l##*:}; rpath=${rpath%% *} + needed=${l##* } + if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then + # object doesn't contain $ORIGIN in its runpath attribute + echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED + else + dir=$(dirname ${obj}) + # replace $ORIGIN with the dirname of the current object for the lookup + opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#") + sneeded=$(echo ${needed} | tr , ' ') + rneeded="" + for lib in ${sneeded}; do + [ -e "${D}/${dir}/${lib}" ] || rneeded="${rneeded},${lib}" + done + rneeded=${rneeded:1} + [ -n "${rneeded}" ] && echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED + fi + done } if [[ ${insecure_rpath} -eq 1 ]] ; then die "Aborting due to serious QA concerns with RUNPATH/RPATH" -- 2.26.2