For bug #160075, send all 'QA Notice' messages to eqawarn. Also, modify eqawarn...
authorZac Medico <zmedico@gentoo.org>
Wed, 10 Jan 2007 04:22:27 +0000 (04:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 10 Jan 2007 04:22:27 +0000 (04:22 -0000)
svn path=/main/trunk/; revision=5507

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

index deb4cf4ccb6709cf7bc53b2d27a81ef6462d0dcb..7158252257a3697de549c6c419172cb07fabaa40 100755 (executable)
--- a/bin/doman
+++ b/bin/doman
@@ -28,7 +28,7 @@ for x in "$@" ; do
        if [[ ${suffix} == "gz" ]] ; then
                realname=${x%.*}
                suffix=${realname##*.}
-               vecho "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 dde131b38153d2c0f18e0bd9cfa572fb9720ad9f..7dc3cc95e82ddf7731bb6135e27d77a4a685fa47 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="/usr/local/sbin:/sbin:/usr/sbin:${PORTAGE_BIN_PATH}:/usr/local/bin:
 
 source "${PORTAGE_BIN_PATH}/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
@@ -1219,9 +1210,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
 
@@ -1494,11 +1483,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 d34af64fa410b97021f4adc6d25d659f32152b73..5b2c82f7ce1f5efa092edabad268d587955e87ab 100644 (file)
@@ -30,7 +30,7 @@ elog_base() {
 
 eqawarn() {
        elog_base QA "$*"
-       echo -e " ${WARN}*${NORMAL} $*"
+       vecho -e " ${WARN}*${NORMAL} $*" >&2
        return 0
 }
 
@@ -224,6 +224,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 9879a83dd07033cc265328b34d2864b24d7ed8d6..198538d0c6fb3b1b5ced6baf9df1ce7d413c96b4 100755 (executable)
@@ -58,10 +58,10 @@ install_qa_check() {
                f=$(scanelf -qyRF '%r %p' "${D}" | 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' "${D}")
                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 ${D}/${D} ]] ; then
                declare -i INSTALLTOD=0
                for i in $(find "${D}/${D}/"); do
-                       echo "QA Notice: /${i##${D}/${D}} installed in \${D}/\${D}"
+                       eqawarn "QA Notice: /${i##${D}/${D}} installed in \${D}/\${D}"
                        ((INSTALLTOD++))
                done
                die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D}/${D}"
@@ -217,10 +217,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
@@ -249,7 +249,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
@@ -260,8 +260,8 @@ install_qa_check() {
        f=$(ls "${D}"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
@@ -272,7 +272,7 @@ install_qa_check() {
                s=${a##*/}
                if grep -qs "${D}" "${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
@@ -296,9 +296,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
@@ -306,9 +306,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 c7f45079da644eac0abaa81d4519d19f8dfb7c86..71446316a141d580e24f004cc2e5020d64fc76d9 100755 (executable)
@@ -5,7 +5,7 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
-vecho "QA Notice: Please stop using me, fix your package instead" 1>&2
+eqawarn "QA Notice: Deprecated call to 'preplib'"
 
 LIBDIR_VAR="LIBDIR_${ABI}"
 if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
index 1cc54a23fcdd96919e8c7817c55f63070885397d..beccec8ffb23cd05a327882f888bc1ae7004057b 100755 (executable)
@@ -12,7 +12,7 @@ else
 fi
 
 if [[ ! -d ${z} ]] ; then
-       vecho "QA Notice: prepman called with non-existent dir '${z#${D}}'" 2>&1
+       eqawarn "QA Notice: prepman called with non-existent dir '${z#${D}}'"
        exit 0
 fi
 
index c9fc10e98abf611a8ff0c3a6406aff97709eab19..1ff4c0d28e59608183831ecee647f7b79e176ebf 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