Index: bin/misc-functions.sh =================================================================== --- bin/misc-functions.sh (revision 3316) +++ bin/misc-functions.sh (working copy) @@ -94,14 +94,18 @@ qa_var="QA_TEXTRELS_${ARCH}" [[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var} [[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS="" - f=() - for s in $(scanelf -qyRF '%t %p' "${D}" | grep -v ' usr/lib/debug/'); do - [[ ${s} == "TEXTREL" ]] && continue + QA_TEXTRELS=$(echo ${QA_TEXTRELS}) # strip newlines + f="" + s=$(scanelf -qyRF '"#t%p"' "${D}" | grep -v 'usr/lib/debug/') + s=$(echo ${s}) # strip newlines + # eval needed to get ${QA_TEXTRELS} expanded so bash splits + # words taking account of spaces in quoted words. + eval "for s in ${s}; do for t in ${QA_TEXTRELS}; do - [[ ${t} == ${s} ]] && continue 2 + [[ \${s} =~ \"^\${t}$\" ]] && continue 2 done - f=( ${f} ${s} ) - done + f=\"\${f}\${s}\n\" + done" if [[ -n ${f} ]] ; then scanelf -qyRF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log vecho -ne '\a\n' @@ -113,13 +117,14 @@ vecho " For more information, see http://hardened.gentoo.org/pic-fix-guide.xml" vecho " Please include this file in your report:" vecho " ${T}/scanelf-textrel.log" - vecho "${f[@]}" + vprintf "${f}" vecho -ne '\a\n' die_msg="${die_msg} textrels," sleep 1 fi # Also, executable stacks only matter on linux (and just glibc atm ...) + f="" case ${CTARGET:-${CHOST}} in *-linux-gnu*) # Check for files with executable stacks, but only on arches which @@ -136,16 +141,18 @@ qa_var="QA_EXECSTACK_${ARCH}" [[ -n ${!qa_var} ]] && QA_EXECSTACK=${!qa_var} [[ -n ${QA_STRICT_EXECSTACK} ]] && QA_EXECSTACK="" - f=$(scanelf -qyRF '%e %p' "${D}" | grep -v ' usr/lib/debug/' | \ - gawk ' - BEGIN { split("'"${QA_EXECSTACK}"'", ignore); } - { for (idx in ignore) - if ($NF ~ "^"ignore[idx]"$") - next; - print; - }') + QA_EXECSTACK=$(echo ${QA_EXECSTACK}) # strip newlines + s=$(scanelf -qyRF '"#e%p"' "${D}" | grep -v 'usr/lib/debug/') + s=$(echo ${s}) # strip newlines + # eval needed to get ${QA_EXECSTACK} expanded so bash splits + # words taking account of spaces in quoted words. + eval "for s in ${s}; do + for e in ${QA_EXECSTACK}; do + [[ \${s} =~ \"^\${e}$\" ]] && continue 2 + done + f=\"\${f}\${s}\n\" + done" ;; - *) f="" ;; esac ;; esac @@ -160,7 +167,7 @@ vecho " For more information, see http://hardened.gentoo.org/gnu-stack.xml" vecho " Please include this file in your report:" vecho " ${T}/scanelf-execstack.log" - vecho "${f}" + vprintf "${f}" vecho -ne '\a\n' die_msg="${die_msg} execstacks" sleep 1 Index: bin/isolated-functions.sh =================================================================== --- bin/isolated-functions.sh (revision 3316) +++ bin/isolated-functions.sh (working copy) @@ -2,11 +2,15 @@ # Distributed under the terms of the GNU General Public License v2 # $Header$ -# Internal logging function, don't use this in ebuilds +# Internal logging functions, don't use these in ebuilds vecho() { [[ ${PORTAGE_QUIET} == "1" ]] || echo ${@} } +vprintf() { + [[ ${PORTAGE_QUIET} == "1" ]] || printf "${@}" +} + elog_base() { local messagetype [ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1