diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-12-17 02:13:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-12-17 02:13:47 +0000 |
commit | 5beb228750198902143da317c02579978e81a704 (patch) | |
tree | eb391bc7fa2b5ce4c7d5a106515259cb7d58ee2b | |
parent | 64bdf0e81ca51b61c4acc0bab94f17ff6e0c9aba (diff) | |
download | portage-5beb228750198902143da317c02579978e81a704.tar.gz portage-5beb228750198902143da317c02579978e81a704.tar.bz2 portage-5beb228750198902143da317c02579978e81a704.zip |
sync with savior branch
svn path=/main/trunk/; revision=2381
-rwxr-xr-x | bin/prepall | 84 |
1 files changed, 66 insertions, 18 deletions
diff --git a/bin/prepall b/bin/prepall index ba3db9d8e..d8ecd642a 100755 --- a/bin/prepall +++ b/bin/prepall @@ -1,39 +1,87 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Id: /var/cvsroot/gentoo-src/portage/bin/prepall,v 1.10 2004/10/14 23:31:33 ferringb Exp $ +# $Id: prepall 2230 2005-11-01 01:35:59Z vapier $ prepallman prepallinfo prepallstrip -#this should help to ensure that all (most?) shared libraries are executable +# this should help to ensure that all (most?) shared libraries are executable +# and that all libtool scripts / static libraries are not executable for i in "${D}"opt/*/lib{,32,64} \ "${D}"lib{,32,64} \ "${D}"usr/lib{,32,64} \ "${D}"usr/X11R6/lib{,32,64} ; do - [ ! -d "${i}" ] && continue + [[ ! -d ${i} ]] && continue for j in "${i}"/*.so.* "${i}"/*.so ; do - [ ! -e "${j}" ] && continue - [ -L "${j}" ] && continue + [[ ! -e ${j} ]] && continue + [[ -L ${j} ]] && continue + [[ -x ${j} ]] && continue echo "making executable: /${j/${D}/}" chmod +x "${j}" done + + for j in "${i}"/*.a "${i}"/*.la ; do + [[ ! -e ${j} ]] && continue + [[ -L ${j} ]] && continue + [[ ! -x ${j} ]] && continue + echo "removing executable bit: /${j/${D}/}" + chmod -x "${j}" + done +done + +# When installing static libraries into /usr/lib and shared libraries into +# /lib, we have to make sure we have a linker script in /usr/lib along side +# the static library, or gcc will utilize the static lib when linking :(. +# http://bugs.gentoo.org/4411 +for a in "${D}"usr/lib*/*.a ; do + s=${a%.a}.so + if [ ! -e "${s}" ] ; then + if [[ ! -e ${s} ]] ; then + s=${s%usr/*}${s##*/usr/} + if [[ -e ${s} ]] ; then + echo -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a" + sleep 1 + fi + fi done -# Move aclocals -for i in `find "${D}"/ -name "aclocal" -type d 2>/dev/null` ; do - [ -z "${i}" ] && continue +# Make sure people don't store libtool files or static libs in /lib +f=$(ls "${D}"lib*/*.{a,la} 2>/dev/null) +if [[ -n ${f} ]] ; then + echo -e "\n\aQA Notice: excessive files found in the / partition\a" + echo "${f}" + sleep 1 +fi - # Strip double '/' - dir1="`echo "${i}" | sed -e 's:/\{2,\}:/:g'`" - dir2="`echo "${D}/usr/share/aclocal" | sed -e 's:/\{2,\}:/:g'`" - - [ "${dir1}" == "${dir2}" ] && continue +# Verify that the libtool files don't contain bogus $D entries. +for a in "${D}"usr/lib*/*.la ; do + s=${a##*/} + if grep -qs "${D}" "${a}" ; then + echo -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a" + sleep 1 + fi +done + +if type -p scanelf > /dev/null ; then - echo "moving aclocal: /${i/${D}/}" - install -d "${D}"usr/share/aclocal - mv "${i}"/* "${D}"usr/share/aclocal - rm -fr "${i}" +# Run some sanity checks on shared libraries +for d in "${D}"lib* "${D}"usr/lib* ; do + f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }') + if [[ -n ${f} ]] ; then + echo -e "\n\aQA Notice: the following shared libraries lack a SONAME\a" + echo "${f}" + sleep 1 + fi + + f=$(scanelf -ByF '%n %p' "${d}"/lib*.so* | gawk '$2 == "" { print }') + if [[ -n ${f} ]] ; then + echo -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a" + echo "${f}" + sleep 1 + fi done + +fi |