summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-02-05 18:57:08 +0000
committerMarius Mauch <genone@gentoo.org>2008-02-05 18:57:08 +0000
commit5baa57a65368472c2c22b9bd2b30e634ef644b92 (patch)
tree1a541d516d6474db0fed8f0ad7345f7af422a978 /bin/misc-functions.sh
parent0b648b2a85b9133d01bb43bcbb9f9a9c1062b07f (diff)
downloadportage-5baa57a65368472c2c22b9bd2b30e634ef644b92.tar.gz
portage-5baa57a65368472c2c22b9bd2b30e634ef644b92.tar.bz2
portage-5baa57a65368472c2c22b9bd2b30e634ef644b92.zip
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
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh23
1 files 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"