From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SQZEx-0004Fz-Dg for garchives@archives.gentoo.org; Sat, 05 May 2012 07:17:22 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8EF62E07BA; Sat, 5 May 2012 07:17:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4A668E07BA for ; Sat, 5 May 2012 07:17:03 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8864F1B4019 for ; Sat, 5 May 2012 07:17:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 4930EE5403 for ; Sat, 5 May 2012 07:17:01 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1336202201.61571e4e8ee3f4f999782c542b4be84d8be8c729.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/misc-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 61571e4e8ee3f4f999782c542b4be84d8be8c729 X-VCS-Branch: master Date: Sat, 5 May 2012 07:17:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: c7fbe031-75bf-4006-91ab-8cee1beaf63e X-Archives-Hash: d74d8cdaff1ac0e2bfb4dde4d4277643 commit: 61571e4e8ee3f4f999782c542b4be84d8be8c729 Author: Zac Medico gentoo org> AuthorDate: Sat May 5 07:16:41 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat May 5 07:16:41 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D61571e4e Create NEEDED.ELF.2 despite RESTRICT=3Dbinchecks. This info is too useful not to have (it's required for things like preserve-libs), and it's tempting for ebuild authors to set RESTRICT=3Dbinchecks for packages containing pre-built binaries. --- bin/misc-functions.sh | 80 ++++++++++++++++++++++++++-----------------= ----- 1 files changed, 43 insertions(+), 37 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 4e81ddf..1098f18 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -433,43 +433,6 @@ install_qa_check() { fi fi =20 - # Save NEEDED information after removing self-contained providers - rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2} - scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS=3D read -r l; do - arch=3D${l%%;*}; l=3D${l#*;} - obj=3D"/${l%%;*}"; l=3D${l#*;} - soname=3D${l%%;*}; l=3D${l#*;} - rpath=3D${l%%;*}; l=3D${l#*;}; [ "${rpath}" =3D " - " ] && rpath=3D= "" - needed=3D${l%%;*}; l=3D${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 - echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_B= UILDDIR}"/build-info/NEEDED.ELF.2 - else - dir=3D${obj%/*} - # replace $ORIGIN with the dirname of the current object for the loo= kup - opath=3D$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1$= {dir}\2#") - sneeded=3D$(echo ${needed} | tr , ' ') - rneeded=3D"" - for lib in ${sneeded}; do - found=3D0 - for path in ${opath//:/ }; do - [ -e "${D}/${path}/${lib}" ] && found=3D1 && break - done - [ "${found}" -eq 0 ] && rneeded=3D"${rneeded},${lib}" - done - rneeded=3D${rneeded:1} - if [ -n "${rneeded}" ]; then - echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED - echo "${arch:3};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE= _BUILDDIR}"/build-info/NEEDED.ELF.2 - fi - fi - done } - - [ -n "${QA_SONAME_NO_SYMLINK}" ] && \ - echo "${QA_SONAME_NO_SYMLINK}" > \ - "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK - if [[ ${insecure_rpath} -eq 1 ]] ; then die "Aborting due to serious QA concerns with RUNPATH/RPATH" elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then @@ -547,6 +510,49 @@ install_qa_check() { PORTAGE_QUIET=3D${tmp_quiet} fi =20 + # Create NEEDED.ELF.2 regardless of RESTRICT=3Dbinchecks, since this in= fo is + # too useful not to have (it's required for things like preserve-libs),= and + # it's tempting for ebuild authors to set RESTRICT=3Dbinchecks for pack= ages + # containing pre-built binaries. + if type -P scanelf > /dev/null ; then + # Save NEEDED information after removing self-contained providers + rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2} + scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS=3D read -r l; do + arch=3D${l%%;*}; l=3D${l#*;} + obj=3D"/${l%%;*}"; l=3D${l#*;} + soname=3D${l%%;*}; l=3D${l#*;} + rpath=3D${l%%;*}; l=3D${l#*;}; [ "${rpath}" =3D " - " ] && rpath=3D= "" + needed=3D${l%%;*}; l=3D${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 + echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_B= UILDDIR}"/build-info/NEEDED.ELF.2 + else + dir=3D${obj%/*} + # replace $ORIGIN with the dirname of the current object for the loo= kup + opath=3D$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1$= {dir}\2#") + sneeded=3D$(echo ${needed} | tr , ' ') + rneeded=3D"" + for lib in ${sneeded}; do + found=3D0 + for path in ${opath//:/ }; do + [ -e "${D}/${path}/${lib}" ] && found=3D1 && break + done + [ "${found}" -eq 0 ] && rneeded=3D"${rneeded},${lib}" + done + rneeded=3D${rneeded:1} + if [ -n "${rneeded}" ]; then + echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED + echo "${arch:3};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE= _BUILDDIR}"/build-info/NEEDED.ELF.2 + fi + fi + done } + + [ -n "${QA_SONAME_NO_SYMLINK}" ] && \ + echo "${QA_SONAME_NO_SYMLINK}" > \ + "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK + fi + local unsafe_files=3D$(find "${ED}" -type f '(' -perm -2002 -o -perm -4= 002 ')' | sed -e "s:^${ED}:/:") if [[ -n ${unsafe_files} ]] ; then eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"