summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-10 04:22:27 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-10 04:22:27 +0000
commitc53f52941c88b24c20204f1795dc02f595ee3a57 (patch)
treeea728689d7e18677337067eeb062f09294070af4 /bin
parentAdd elog related variables to make.conf(5) with a pointer to make.conf.exampl... (diff)
downloadportage-multirepo-c53f52941c88b24c20204f1795dc02f595ee3a57.tar.gz
portage-multirepo-c53f52941c88b24c20204f1795dc02f595ee3a57.tar.bz2
portage-multirepo-c53f52941c88b24c20204f1795dc02f595ee3a57.zip
For bug #160075, send all 'QA Notice' messages to eqawarn. Also, modify eqawarn to use vecho and send ouput to stderr.
svn path=/main/trunk/; revision=5507
Diffstat (limited to 'bin')
-rwxr-xr-xbin/doman2
-rwxr-xr-xbin/ebuild.sh28
-rw-r--r--bin/isolated-functions.sh11
-rwxr-xr-xbin/misc-functions.sh88
-rwxr-xr-xbin/preplib2
-rwxr-xr-xbin/prepman2
-rwxr-xr-xbin/prepstrip5
7 files changed, 68 insertions, 70 deletions
diff --git a/bin/doman b/bin/doman
index deb4cf4c..71582522 100755
--- 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}
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index dde131b3..7dc3cc95 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -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}
}";
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index d34af64f..5b2c82f7 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -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 "$@"
}
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 9879a83d..198538d0 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -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
diff --git a/bin/preplib b/bin/preplib
index c7f45079..71446316 100755
--- a/bin/preplib
+++ b/bin/preplib
@@ -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
diff --git a/bin/prepman b/bin/prepman
index 1cc54a23..beccec8f 100755
--- a/bin/prepman
+++ b/bin/prepman
@@ -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
diff --git a/bin/prepstrip b/bin/prepstrip
index c9fc10e9..1ff4c0d2 100755
--- a/bin/prepstrip
+++ b/bin/prepstrip
@@ -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