Merged from trunk 5506:5507
authorFabian Groffen <grobian@gentoo.org>
Fri, 12 Jan 2007 19:24:50 +0000 (19:24 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 12 Jan 2007 19:24:50 +0000 (19:24 -0000)
For bug #160075, send all 'QA Notice' messages to eqawarn.  Also, modify
eqawarn to use vecho and send ouput to stderr.

svn path=/main/branches/prefix/; revision=5611

bin/doman
bin/ebuild.sh
bin/isolated-functions.sh
bin/misc-functions.sh
bin/preplib
bin/prepman
bin/prepstrip

index 75a21affe4fdaabce9c8c5944a3c3c6ca405ca77..c39d897b3a25f67c24d6d3c9d7e1622bd144898b 100755 (executable)
--- a/bin/doman
+++ b/bin/doman
@@ -26,7 +26,7 @@ for x in "$@" ; do
        if [[ ${suffix} == "gz" ]] ; then
                realname=${x%.*}
                suffix=${realname##*.}
-               echo "QA Notice: you should let portage compress '${realname}' for you" 2>&1
+               eqawarn "QA Notice: File is already compressed: '${realname}'"
        fi
 
        mandir=${i18n}man${suffix:0:1}
index 6d0ee1a43015d52be8e5e0e209ceace44a24c490..5e77aa6021e3d3c18a1e31fa0afeb2ec01c73579 100755 (executable)
@@ -27,9 +27,9 @@ qa_source() {
        local shopts=$(shopt) OLDIFS="$IFS"
        source "$@" || return 1
        [[ $shopts != $(shopt) ]] &&
-               vecho "QA Notice: Global shell options were changed and not restored while sourcing $1"
+               eqawarn "QA Notice: Global shell options changed and were not restored while sourcing '$*'"
        [[ "$IFS" != "$OLDIFS" ]] &&
-               vecho "QA Notice: IFS was changed and not reset while sourcing $1"
+               eqawarn "QA Notice: Global IFS changed and was not restored while sourcing '$*'"
        return 0
 }
 
@@ -37,9 +37,9 @@ qa_call() {
        local shopts=$(shopt) OLDIFS="$IFS"
        "$@" || return 1
        [[ $shopts != $(shopt) ]] &&
-               vecho "QA Notice: Global shell options were changed while calling $1"
+               eqawarn "QA Notice: Global shell options changed and were not restored while calling '$*'"
        [[ "$IFS" != "$OLDIFS" ]] &&
-               vecho "QA Notice: IFS was changed and not reset while calling $1"
+               eqawarn "QA Notice: Global IFS changed and was not restored while calling '$*'"
        return 0
 }
 
@@ -80,15 +80,6 @@ export PATH="${DEFAULT_PATH}:${PORTAGE_BIN_PATH}:${ROOTPATH}"
 
 source "@PORTAGE_BASE@"/bin/isolated-functions.sh &>/dev/null
 
-case "${NOCOLOR:-false}" in
-       yes|true)
-               unset_colors
-               ;;
-       no|false)
-               set_colors
-               ;;
-esac
-
 [[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
 
 # the sandbox is disabled by default except when overridden in the relevant stages
@@ -179,7 +170,7 @@ useq() {
 
        # Make sure we have this USE flag in IUSE
        if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then
-               vecho "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2
+               eqawarn "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"
        fi
 
        if hasq ${u} ${USE} ; then
@@ -1374,9 +1365,7 @@ inherit() {
                        # false alarms due to INHERITED in /var/db/pkg being outdated
                        # in comparison the the eclasses from the portage tree.
                        if ! hasq $ECLASS $INHERITED; then
-                               vecho
-                               vecho "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF" >&2
-                               vecho
+                               eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF"
                        fi
                fi
 
@@ -1649,11 +1638,10 @@ if hasq "depend" "${EBUILD_SH_ARGS}"; then
                        BODY="${BIN_PATH} \"\$@\"; return \$?"
                fi
                FUNC_SRC="${BIN}() {
-               vecho -n \"QA Notice: ${BIN} in global scope: \" >&2
                if [ \$ECLASS_DEPTH -gt 0 ]; then
-                       vecho \"eclass \${ECLASS}\" >&2
+                       eqawarn \"QA Notice: '${BIN}' called in global scope: eclass \${ECLASS}\"
                else
-                       vecho \"\${CATEGORY}/\${PF}\" >&2
+                       eqawarn \"QA Notice: '${BIN}' called in global scope: \${CATEGORY}/\${PF}\"
                fi
                ${BODY}
                }";
index b28167f788b5f53c883fe5ab6549e934c1c4b4cd..25ef146a137fa0523402117c538f335d1216f550 100644 (file)
@@ -30,7 +30,7 @@ elog_base() {
 
 eqawarn() {
        elog_base QA "$*"
-       echo -e " ${WARN}*${NORMAL} $*"
+       vecho -e " ${WARN}*${NORMAL} $*" >&2
        return 0
 }
 
@@ -226,6 +226,15 @@ RC_INDENTATION=''
 RC_DEFAULT_INDENT=2
 RC_DOT_PATTERN=''
 
+case "${NOCOLOR:-false}" in
+       yes|true)
+               unset_colors
+               ;;
+       no|false)
+               set_colors
+               ;;
+esac
+
 has() {
        hasq "$@"
 }
index 49f392b5612ce3da1c4e6222565e78da6dfb122e..584ed9b45971552be34bcd06df196f1617997dfb 100644 (file)
@@ -58,10 +58,10 @@ install_qa_check() {
                f=$(scanelf -qyRF '%r %p' "${ED}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )")
                if [[ -n ${f} ]] ; then
                        vecho -ne '\a\n'
-                       vecho "QA Notice: the following files contain insecure RUNPATH's"
-                       vecho " Please file a bug about this at http://bugs.gentoo.org/"
-                       vecho " with the maintaining herd of the package."
-                       vecho "${f}"
+                       eqawarn "QA Notice: The following files contain insecure RUNPATH's"
+                       eqawarn " Please file a bug about this at http://bugs.gentoo.org/"
+                       eqawarn " with the maintaining herd of the package."
+                       eqawarn "${f}"
                        vecho -ne '\a\n'
                        if has stricter ${FEATURES} ; then
                                insecure_rpath=1
@@ -75,10 +75,10 @@ install_qa_check() {
                f=$(scanelf -qyRF '%b %p' "${ED}")
                if [[ -n ${f} ]] ; then
                        vecho -ne '\a\n'
-                       vecho "QA Notice: the following files are setXid, dyn linked, and using lazy bindings"
-                       vecho " This combination is generally discouraged.  Try re-emerging the package:"
-                       vecho " LDFLAGS='-Wl,-z,now' emerge ${PN}"
-                       vecho "${f}"
+                       eqawarn "QA Notice: The following files are setXid, dyn linked, and using lazy bindings"
+                       eqawarn " This combination is generally discouraged.  Try re-emerging the package:"
+                       eqawarn " LDFLAGS='-Wl,-z,now' emerge ${PN}"
+                       eqawarn "${f}"
                        vecho -ne '\a\n'
                        # Do not fail here until we have sorted out the lazy issues with security team
                        #die_msg="${die_msg} setXid lazy bindings,"
@@ -98,15 +98,15 @@ install_qa_check() {
                if [[ -n ${f} ]] ; then
                        scanelf -qyRF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log
                        vecho -ne '\a\n'
-                       vecho "QA Notice: the following files contain runtime text relocations"
-                       vecho " Text relocations force the dynamic linker to perform extra"
-                       vecho " work at startup, waste system resources, and may pose a security"
-                       vecho " risk.  On some architectures, the code may not even function"
-                       vecho " properly, if at all."
-                       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}"
+                       eqawarn "QA Notice: The following files contain runtime text relocations"
+                       eqawarn " Text relocations force the dynamic linker to perform extra"
+                       eqawarn " work at startup, waste system resources, and may pose a security"
+                       eqawarn " risk.  On some architectures, the code may not even function"
+                       eqawarn " properly, if at all."
+                       eqawarn " For more information, see http://hardened.gentoo.org/pic-fix-guide.xml"
+                       eqawarn " Please include this file in your report:"
+                       eqawarn " ${T}/scanelf-textrel.log"
+                       eqawarn "${f}"
                        vecho -ne '\a\n'
                        die_msg="${die_msg} textrels,"
                        sleep 1
@@ -143,14 +143,14 @@ install_qa_check() {
                        # One more pass to help devs track down the source
                        scanelf -qyRF '%e %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-execstack.log
                        vecho -ne '\a\n'
-                       vecho "QA Notice: the following files contain executable stacks"
-                       vecho " Files with executable stacks will not work properly (or at all!)"
-                       vecho " on some architectures/operating systems.  A bug should be filed"
-                       vecho " at http://bugs.gentoo.org/ to make sure the file is fixed."
-                       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}"
+                       eqawarn "QA Notice: The following files contain executable stacks"
+                       eqawarn " Files with executable stacks will not work properly (or at all!)"
+                       eqawarn " on some architectures/operating systems.  A bug should be filed"
+                       eqawarn " at http://bugs.gentoo.org/ to make sure the file is fixed."
+                       eqawarn " For more information, see http://hardened.gentoo.org/gnu-stack.xml"
+                       eqawarn " Please include this file in your report:"
+                       eqawarn " ${T}/scanelf-execstack.log"
+                       eqawarn "${f}"
                        vecho -ne '\a\n'
                        die_msg="${die_msg} execstacks"
                        sleep 1
@@ -170,8 +170,8 @@ install_qa_check() {
                        f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
                        if [[ -n ${f} ]] ; then
                                vecho -ne '\a\n'
-                               vecho "QA Notice: the following shared libraries lack a SONAME"
-                               vecho "${f}"
+                               eqawarn "QA Notice: The following shared libraries lack a SONAME"
+                               eqawarn "${f}"
                                vecho -ne '\a\n'
                                sleep 1
                        fi
@@ -179,8 +179,8 @@ install_qa_check() {
                        f=$(scanelf -ByF '%n %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
                        if [[ -n ${f} ]] ; then
                                vecho -ne '\a\n'
-                               vecho "QA Notice: the following shared libraries lack NEEDED entries"
-                               vecho "${f}"
+                               eqawarn "QA Notice: The following shared libraries lack NEEDED entries"
+                               eqawarn "${f}"
                                vecho -ne '\a\n'
                                sleep 1
                        fi
@@ -196,7 +196,7 @@ install_qa_check() {
        if [[ -d ${ED}/${ED} ]] ; then
                declare -i INSTALLTOD=0
                for i in $(find "${ED}/${ED}/"); do
-                       echo "QA Notice: /${i##${ED}/${ED}} installed in \${ED}/\${ED}"
+                       eqawarn "QA Notice: /${i##${ED}/${ED}} installed in \${ED}/\${ED}"
                        ((INSTALLTOD++))
                done
                die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${ED}/${ED}"
@@ -242,10 +242,10 @@ install_qa_check() {
                                linkdest=$(readlink "${j}")
                                if [[ ${linkdest} == /* ]] ; then
                                        vecho -ne '\a\n'
-                                       vecho "QA Notice: Found an absolute symlink in a library directory:"
-                                       vecho "           ${j#${D}} -> ${linkdest}"
-                                       vecho "           It should be a relative symlink if in the same directory"
-                                       vecho "           or a linker script if it crosses the /usr boundary."
+                                       eqawarn "QA Notice: Found an absolute symlink in a library directory:"
+                                       eqawarn "           ${j#${D}} -> ${linkdest}"
+                                       eqawarn "           It should be a relative symlink if in the same directory"
+                                       eqawarn "           or a linker script if it crosses the /usr boundary."
                                fi
                                continue
                        fi
@@ -274,7 +274,7 @@ install_qa_check() {
                        s=${s%usr/*}${s##*/usr/}
                        if [[ -e ${s} ]] ; then
                                vecho -ne '\a\n'
-                               vecho "QA Notice: missing gen_usr_ldscript for ${s##*/}"
+                               eqawarn "QA Notice: Missing gen_usr_ldscript for ${s##*/}"
                                abort="yes"
                        fi
                fi
@@ -285,8 +285,8 @@ install_qa_check() {
        f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null)
        if [[ -n ${f} ]] ; then
                vecho -ne '\a\n'
-               vecho "QA Notice: excessive files found in the / partition"
-               vecho "${f}"
+               eqawarn "QA Notice: Excessive files found in the / partition"
+               eqawarn "${f}"
                vecho -ne '\a\n'
                die "static archives (*.a) and libtool library files (*.la) do not belong in /"
        fi
@@ -297,7 +297,7 @@ install_qa_check() {
                s=${a##*/}
                if grep -qs "${ED}" "${a}" ; then
                        vecho -ne '\a\n'
-                       vecho "QA Notice: ${s} appears to contain PORTAGE_TMPDIR paths"
+                       eqawarn "QA Notice: ${s} appears to contain PORTAGE_TMPDIR paths"
                        abort="yes"
                fi
        done
@@ -321,9 +321,9 @@ install_qa_check() {
                        f=$(LC_ALL=C grep "${m}" "${PORTAGE_LOG_FILE}")
                        if [[ -n ${f} ]] ; then
                                vecho -ne '\a\n'
-                               vecho "QA Notice: Package has poor programming practices which may compile"
-                               vecho "           fine but exhibit random runtime failures."
-                               vecho "${f}"
+                               eqawarn "QA Notice: Package has poor programming practices which may compile"
+                               eqawarn "           fine but exhibit random runtime failures."
+                               eqawarn "${f}"
                                vecho -ne '\a\n'
                                abort="yes"
                        fi
@@ -331,9 +331,9 @@ install_qa_check() {
                f=$(cat "${PORTAGE_LOG_FILE}" | check-implicit-pointer-usage.py)
                if [[ -n ${f} ]] ; then
                        vecho -ne '\a\n'
-                       vecho "QA Notice: Package has poor programming practices which may compile"
-                       vecho "           but will almost certainly crash on 64bit architectures."
-                       vecho "${f}"
+                       eqawarn "QA Notice: Package has poor programming practices which may compile"
+                       eqawarn "           but will almost certainly crash on 64bit architectures."
+                       eqawarn "${f}"
                        vecho -ne '\a\n'
                        abort="yes"
                fi
index 280d1b56689fc55fcb089567cb132fc66b61921c..caefe5da3c98bcfa39427ce55afa84192fafb7b7 100755 (executable)
@@ -3,7 +3,9 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/preplib,v 1.7.2.1 2005/01/02 09:36:02 jstubbs Exp $
 
-echo "QA Notice: Please stop using me, fix your package instead" 1>&2
+source "${PORTAGE_BIN_PATH:-${EPREFIX}/usr/lib/portage/bin}"/isolated-functions.sh
+
+eqawarn "QA Notice: Deprecated call to 'preplib'"
 
 LIBDIR_VAR="LIBDIR_${ABI}"
 if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
index 263782c6118a0a49802146bfb34104561d112f65..0ba2bd35bd45c2f3269d05e8009c4bcb342f128d 100755 (executable)
@@ -10,7 +10,7 @@ else
 fi
 
 if [[ ! -d ${z} ]] ; then
-       echo "QA Notice: prepman called with non-existent dir '${z#${ED}}'" 2>&1
+       eqawarn "QA Notice: prepman called with non-existent dir '${z#${ED}}'"
        exit 0
 fi
 
index e4e7a0d7fea555ba7861ab946c41abb3c4c28127..4997a4953264b73e597613df73c9067c10e117a2 100755 (executable)
@@ -55,8 +55,9 @@ save_elf_debug() {
 # They prevent us from getting the splitdebug data.
 f="$(scanelf -yqRBF '#k%F' -k '!.symtab' "$@")"
 if [[ -n "${f}" ]] ; then
-       vecho -e "\n\aQA Notice: pre-stripped files found:\a"
-       vecho "${f}"
+       vecho -e "\a\n"
+       eqawarn "QA Notice: Pre-stripped files found:"
+       eqawarn "${f}"
        echo "${f}" > "${T}"/scanelf-already-stripped.log
 fi