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 1ReNcM-0001Zm-2W for garchives@archives.gentoo.org; Sat, 24 Dec 2011 09:10:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 32D3C21C09D; Sat, 24 Dec 2011 09:10:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E56AC21C09D for ; Sat, 24 Dec 2011 09:10:06 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 56B9E1B4019 for ; Sat, 24 Dec 2011 09:10:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id ABDF780042 for ; Sat, 24 Dec 2011 09:10:05 +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: 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: b91754cb94e3f3d2db50768ec7cad47314d806ce Date: Sat, 24 Dec 2011 09:10:05 +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: c82d23aa-523d-4c65-94fd-5e7a64b51fff X-Archives-Hash: f3af619be15ae45707bc6ef2c07158b6 commit: b91754cb94e3f3d2db50768ec7cad47314d806ce Author: Zac Medico gentoo org> AuthorDate: Sat Dec 24 09:07:39 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Dec 24 09:07:39 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db91754cb Do CFLAGS check before strip for bug #395877. --- bin/misc-functions.sh | 144 +++++++++++++++++++++++++------------------= ------ 1 files changed, 73 insertions(+), 71 deletions(-) diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index dcfdceb..9d8244d 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -148,12 +148,83 @@ prepcompress() { } =20 install_qa_check() { - local f i x + local f i qa_var x [[ " ${FEATURES} " =3D=3D *" force-prefix "* ]] || \ case "$EAPI" in 0|1|2) local ED=3D${D} ;; esac =20 cd "${ED}" || die "cd failed" =20 + # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since + # QA_DT_HASH is deprecated. + qa_var=3D"QA_FLAGS_IGNORED_${ARCH/-/_}" + eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=3D(\"\${${qa_var}[@]}\")= " + if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then + local shopts=3D$- + set -o noglob + QA_FLAGS_IGNORED=3D(${QA_FLAGS_IGNORED}) + set +o noglob + set -${shopts} + fi + + qa_var=3D"QA_DT_HASH_${ARCH/-/_}" + eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=3D(\"\${${qa_var}[@]}\")" + if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then + local shopts=3D$- + set -o noglob + QA_DT_HASH=3D(${QA_DT_HASH}) + set +o noglob + set -${shopts} + fi + + if [[ -n ${QA_DT_HASH} ]] ; then + QA_FLAGS_IGNORED=3D("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}") + unset QA_DT_HASH + fi + + # Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since + # QA_STRICT_DT_HASH is deprecated + if [ "${QA_STRICT_FLAGS_IGNORED-unset}" =3D unset ] && \ + [ "${QA_STRICT_DT_HASH-unset}" !=3D unset ] ; then + QA_STRICT_FLAGS_IGNORED=3D1 + unset QA_STRICT_DT_HASH + fi + + # Check for files built without respecting *FLAGS. Note that + # -frecord-gcc-switches must be in all *FLAGS variables, in + # order to avoid false positive results here. + # NOTE: This check must execute before prepall/prepstrip, since + # prepstrip strips the .GCC.command.line sections. + if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT} && \ + [[ "${CFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ + [[ "${CXXFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ + [[ "${FFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ + [[ "${FCFLAGS}" =3D=3D *-frecord-gcc-switches* ]] ; then + f=3D$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s= :\!.GCC.command.line ::") + if [[ -n ${f} ]] ; then + echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log + if [ "${QA_STRICT_FLAGS_IGNORED-unset}" =3D unset ] ; then + for x in "${QA_FLAGS_IGNORED[@]}" ; do + sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log + done + fi + # Filter anything under /usr/lib/debug/ in order to avoid + # duplicate warnings for splitdebug files. + sed -e "s#^usr/lib/debug/.*##" -e "/^\$/d" -e "s#^#/#" \ + -i "${T}"/scanelf-ignored-CFLAGS.log + f=3D$(<"${T}"/scanelf-ignored-CFLAGS.log) + if [[ -n ${f} ]] ; then + vecho -ne '\n' + eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS have= been detected${NORMAL}" + eqawarn " Please include the following list of files in your report:= " + eqawarn "${f}" + vecho -ne '\n' + sleep 1 + else + rm -f "${T}"/scanelf-ignored-CFLAGS.log + fi + fi + fi + export STRIP_MASK prepall has "${EAPI}" 0 1 2 3 || prepcompress @@ -185,7 +256,7 @@ install_qa_check() { fi =20 if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then - local qa_var insecure_rpath=3D0 tmp_quiet=3D${PORTAGE_QUIET} + local insecure_rpath=3D0 tmp_quiet=3D${PORTAGE_QUIET} local x =20 # display warnings when using stricter because we die afterwards @@ -308,75 +379,6 @@ install_qa_check() { sleep 1 fi =20 - # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since - # QA_DT_HASH is deprecated. - qa_var=3D"QA_FLAGS_IGNORED_${ARCH/-/_}" - eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=3D(\"\${${qa_var}[@]}\"= )" - if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then - local shopts=3D$- - set -o noglob - QA_FLAGS_IGNORED=3D(${QA_FLAGS_IGNORED}) - set +o noglob - set -${shopts} - fi - - qa_var=3D"QA_DT_HASH_${ARCH/-/_}" - eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=3D(\"\${${qa_var}[@]}\")" - if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then - local shopts=3D$- - set -o noglob - QA_DT_HASH=3D(${QA_DT_HASH}) - set +o noglob - set -${shopts} - fi - - if [[ -n ${QA_DT_HASH} ]] ; then - QA_FLAGS_IGNORED=3D("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}") - unset QA_DT_HASH - fi - - # Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since - # QA_STRICT_DT_HASH is deprecated - if [ "${QA_STRICT_FLAGS_IGNORED-unset}" =3D unset ] && \ - [ "${QA_STRICT_DT_HASH-unset}" !=3D unset ] ; then - QA_STRICT_FLAGS_IGNORED=3D1 - unset QA_STRICT_DT_HASH - fi - - # Check for files built without respecting *FLAGS. Note that - # -frecord-gcc-switches must be in all *FLAGS variables, in - # order to avoid false positive results here. - if [[ "${CFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ - [[ "${CXXFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ - [[ "${FFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ - [[ "${FCFLAGS}" =3D=3D *-frecord-gcc-switches* ]] && \ - ! has binchecks ${RESTRICT} ; then - f=3D$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "= s:\!.GCC.command.line ::") - if [[ -n ${f} ]] ; then - echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log - if [ "${QA_STRICT_FLAGS_IGNORED-unset}" =3D unset ] ; then - for x in "${QA_FLAGS_IGNORED[@]}" ; do - sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log - done - fi - # Filter anything under /usr/lib/debug/ in order to avoid - # duplicate warnings for splitdebug files. - sed -e "s#^usr/lib/debug/.*##" -e "/^\$/d" -e "s#^#/#" \ - -i "${T}"/scanelf-ignored-CFLAGS.log - f=3D$(<"${T}"/scanelf-ignored-CFLAGS.log) - if [[ -n ${f} ]] ; then - vecho -ne '\n' - eqawarn "${BAD}QA Notice: Files built without respecting CFLAGS hav= e been detected${NORMAL}" - eqawarn " Please include the following list of files in your report= :" - eqawarn "${f}" - vecho -ne '\n' - sleep 1 - else - rm -f "${T}"/scanelf-ignored-CFLAGS.log - fi - fi - fi - # Check for files built without respecting LDFLAGS if [[ "${LDFLAGS}" =3D=3D *,--hash-style=3Dgnu* ]] && \ ! has binchecks ${RESTRICT} ; then=20