From 1f8b4927f9e7f7a1918cc8d522ead79ce0aeae99 Mon Sep 17 00:00:00 2001 From: Simon Stelling Date: Mon, 1 May 2006 21:12:04 +0000 Subject: [PATCH] make portage shut up if --quiet is given; bug 62273 svn path=/main/trunk/; revision=3296 --- bin/doexe | 4 +- bin/doins | 10 ++-- bin/doman | 8 ++- bin/ebuild.sh | 65 +++++++++++----------- bin/isolated-functions.sh | 6 +- bin/misc-functions.sh | 113 ++++++++++++++++++++------------------ bin/prepall | 26 +++++---- bin/prepalldocs | 8 ++- bin/prepallinfo | 4 +- bin/prepallman | 4 +- bin/prepinfo | 8 ++- bin/preplib | 4 +- bin/prepman | 10 ++-- bin/prepstrip | 8 ++- 14 files changed, 155 insertions(+), 123 deletions(-) diff --git a/bin/doexe b/bin/doexe index 949527768..257bfea8e 100755 --- a/bin/doexe +++ b/bin/doexe @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doexe,v 1.10.2.1 2004/12/06 03:01:43 carpaski Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [[ $# -lt 1 ]] ; then echo "$0: at least one argument needed" 1>&2 exit 1 @@ -17,7 +19,7 @@ for x in "$@" ; do cp "${x}" "${T}" mysrc="${T}"/$(/usr/bin/basename "${x}") elif [ -d "${x}" ] ; then - echo "doexe: warning, skipping directory ${x}" + vecho "doexe: warning, skipping directory ${x}" continue else mysrc="${x}" diff --git a/bin/doins b/bin/doins index 99e3ffb3a..aab6e9916 100755 --- a/bin/doins +++ b/bin/doins @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doins,v 1.7.2.2 2004/12/17 22:25:13 carpaski Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [ $# -lt 1 ] ; then echo "${0}: at least one argument needed" exit 1 @@ -21,10 +23,10 @@ if [ ${INSDEPTH} -gt 30 ] ; then fi if [ "${INSDESTTREE%${D}*}" == "" ]; then - echo "-------------------------------------------------------" 1>&2 - echo "You should not use \${D} with helpers." 1>&2 - echo " --> ${INSDESTTREE}" 1>&2 - echo "-------------------------------------------------------" 1>&2 + vecho "-------------------------------------------------------" 1>&2 + vecho "You should not use \${D} with helpers." 1>&2 + vecho " --> ${INSDESTTREE}" 1>&2 + vecho "-------------------------------------------------------" 1>&2 #exit 1 fi diff --git a/bin/doman b/bin/doman index 658e34772..a04339d52 100755 --- a/bin/doman +++ b/bin/doman @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/doman,v 1.13.2.2 2005/07/29 05:55:34 vapier Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [[ $# -lt 1 ]] ; then echo "$0: at least one argument needed" 1>&2 exit 1 @@ -26,7 +28,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 + vecho "QA Notice: you should let portage compress '${realname}' for you" 2>&1 fi mandir=${i18n}man${suffix:0:1} @@ -40,11 +42,11 @@ for x in "$@" ; do install -m0644 "${x}" "${D}/usr/share/man/${mandir}" ((ret+=$?)) elif [[ ! -e ${x} ]] ; then - echo "doman: ${x} does not exist" 1>&2 + vecho "doman: ${x} does not exist" 1>&2 ((++ret)) fi else - echo "doman: '${x}' is probably not a man page; skipping" 1>&2 + vecho "doman: '${x}' is probably not a man page; skipping" 1>&2 ((++ret)) fi done diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 7e04c04ba..1453827cf 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -121,7 +121,6 @@ esyslog() { return 0 } - use() { useq ${1} } @@ -146,7 +145,7 @@ useq() { # Make sure we have this USE flag in IUSE if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then - echo "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2 + vecho "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2 fi if hasq ${u} ${USE} ; then @@ -354,7 +353,7 @@ unpack() { [ -z "$*" ] && die "Nothing passed to the 'unpack' command" for x in "$@"; do - echo ">>> Unpacking ${x} to ${PWD}" + vecho ">>> Unpacking ${x} to ${PWD}" y=${x%.*} y=${y##*.} @@ -406,7 +405,7 @@ unpack() { ar x "${srcdir}/${x}" || die "$myfail" ;; *) - echo "unpack ${x}: file format not recognized. Ignoring." + vecho "unpack ${x}: file format not recognized. Ignoring." ;; esac done @@ -433,7 +432,7 @@ econf() { if [ -x "${ECONF_SOURCE}/configure" ]; then if [ -e /usr/share/gnuconfig/ ]; then for x in $(find "${WORKDIR}" -type f '(' -name config.guess -o -name config.sub ')') ; do - echo " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}" + vecho " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}" cp -f /usr/share/gnuconfig/${x##*/} ${x} done fi @@ -500,7 +499,7 @@ econf() { CONFCACHE= fi - echo ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \ + vecho ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \ --prefix=/usr \ --host=${CHOST} \ --mandir=/usr/share/man \ @@ -602,19 +601,19 @@ src_compile() { src_test() { addpredict / if emake -j1 check -n &> /dev/null; then - echo ">>> Test phase [check]: ${CATEGORY}/${PF}" + vecho ">>> Test phase [check]: ${CATEGORY}/${PF}" if ! emake -j1 check; then hasq test $FEATURES && die "Make check failed. See above for details." hasq test $FEATURES || eerror "Make check failed. See above for details." fi elif emake -j1 test -n &> /dev/null; then - echo ">>> Test phase [test]: ${CATEGORY}/${PF}" + vecho ">>> Test phase [test]: ${CATEGORY}/${PF}" if ! emake -j1 test; then hasq test $FEATURES && die "Make test failed. See above for details." hasq test $FEATURES || eerror "Make test failed. See above for details." fi else - echo ">>> Test phase [none]: ${CATEGORY}/${PF}" + vecho ">>> Test phase [none]: ${CATEGORY}/${PF}" fi SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}" } @@ -666,27 +665,27 @@ dyn_unpack() { local x local checkme for x in ${AA}; do - echo ">>> Checking ${x}'s mtime..." + vecho ">>> Checking ${x}'s mtime..." if [ "${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/${x}" -nt "${WORKDIR}" ]; then - echo ">>> ${x} has been updated; recreating WORKDIR..." + vecho ">>> ${x} has been updated; recreating WORKDIR..." newstuff="yes" rm -rf "${WORKDIR}" break fi done if [ "${EBUILD}" -nt "${WORKDIR}" ]; then - echo ">>> ${EBUILD} has been updated; recreating WORKDIR..." + vecho ">>> ${EBUILD} has been updated; recreating WORKDIR..." newstuff="yes" rm -rf "${WORKDIR}" elif [ ! -f "${PORTAGE_BUILDDIR}/.unpacked" ]; then - echo ">>> Not marked as unpacked; recreating WORKDIR..." + vecho ">>> Not marked as unpacked; recreating WORKDIR..." newstuff="yes" rm -rf "${WORKDIR}" fi fi if [ -e "${WORKDIR}" ]; then if [ "$newstuff" == "no" ]; then - echo ">>> WORKDIR is up-to-date, keeping..." + vecho ">>> WORKDIR is up-to-date, keeping..." [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack return 0 fi @@ -696,10 +695,10 @@ dyn_unpack() { install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'" fi cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`" - echo ">>> Unpacking source..." + vecho ">>> Unpacking source..." src_unpack touch "${PORTAGE_BUILDDIR}/.unpacked" || die "IO Failure -- Failed 'touch .unpacked' in ${PORTAGE_BUILDDIR}" - echo ">>> Source unpacked." + vecho ">>> Source unpacked." cd "${PORTAGE_BUILDDIR}" [ "$(type -t post_src_unpack)" == "function" ] && post_src_unpack @@ -908,8 +907,8 @@ dyn_compile() { cp "${EBUILD}" "build-info/${PF}.ebuild" if [ "${PORTAGE_BUILDDIR}/.compiled" -nt "${WORKDIR}" ]; then - echo ">>> It appears that ${PN} is already compiled; skipping." - echo ">>> (clean to force compilation)" + vecho ">>> It appears that ${PN} is already compiled; skipping." + vecho ">>> (clean to force compilation)" trap SIGINT SIGQUIT [ "$(type -t post_src_compile)" == "function" ] && post_src_compile return @@ -924,9 +923,9 @@ dyn_compile() { #some packages use an alternative to $S to build in, cause #our libtool to create problematic .la files export PWORKDIR="$WORKDIR" - echo ">>> Compiling source in ${srcdir} ..." + vecho ">>> Compiling source in ${srcdir} ..." src_compile - echo ">>> Source compiled." + vecho ">>> Source compiled." #|| abort_compile "fail" cd "${PORTAGE_BUILDDIR}" touch .compiled @@ -959,7 +958,7 @@ dyn_compile() { dyn_test() { [ "$(type -t pre_src_test)" == "function" ] && pre_src_test if [ "${PORTAGE_BUILDDIR}/.tested" -nt "${WORKDIR}" ]; then - echo ">>> It appears that ${PN} has already been tested; skipping." + vecho ">>> It appears that ${PN} has already been tested; skipping." [ "$(type -t post_src_test)" == "function" ] && post_src_test return fi @@ -969,9 +968,9 @@ dyn_test() { fi if hasq test $RESTRICT; then ewarn "Skipping make test/check due to ebuild restriction." - echo ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}" + vecho ">>> Test phase [explicitly disabled]: ${CATEGORY}/${PF}" elif ! hasq test $FEATURES; then - echo ">>> Test phase [not enabled]: ${CATEGORY}/${PF}" + vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}" else src_test fi @@ -991,8 +990,8 @@ dyn_install() { if [ -d "${S}" ]; then cd "${S}" fi - echo - echo ">>> Install ${PF} into ${D} category ${CATEGORY}" + vecho + vecho ">>> Install ${PF} into ${D} category ${CATEGORY}" #our custom version of libtool uses $S and $D to fix #invalid paths in .la files export S D @@ -1001,8 +1000,8 @@ dyn_install() { export PWORKDIR="$WORKDIR" src_install touch "${PORTAGE_BUILDDIR}/.installed" - echo ">>> Completed installing ${PF} into ${D}" - echo + vecho ">>> Completed installing ${PF} into ${D}" + vecho cd ${PORTAGE_BUILDDIR} [ "$(type -t post_src_install)" == "function" ] && post_src_install trap SIGINT SIGQUIT @@ -1150,9 +1149,9 @@ inherit() { if [ "$EBUILD_PHASE" != "depend" ]; then if ! hasq $ECLASS $INHERITED; then - echo - echo "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF" >&2 - echo + vecho + vecho "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF" >&2 + vecho fi fi @@ -1412,11 +1411,11 @@ if hasq "depend" "$@"; then BODY="${BIN_PATH} \"\$@\"; return \$?" fi FUNC_SRC="${BIN}() { - echo -n \"QA Notice: ${BIN} in global scope: \" >&2 + vecho -n \"QA Notice: ${BIN} in global scope: \" >&2 if [ \$ECLASS_DEPTH -gt 0 ]; then - echo \"eclass \${ECLASS}\" >&2 + vecho \"eclass \${ECLASS}\" >&2 else - echo \"\${CATEGORY}/\${PF}\" >&2 + vecho \"\${CATEGORY}/\${PF}\" >&2 fi ${BODY} }"; diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 3d3b93741..03cba8143 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -3,6 +3,10 @@ # $Header$ # Internal logging function, don't use this in ebuilds +vecho() { + [[ ${PORTAGE_QUIET} == "1" ]] || echo ${@} +} + elog_base() { local messagetype [ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1 @@ -12,7 +16,7 @@ elog_base() { shift ;; *) - echo -e " ${BAD}*${NORMAL} Invalid use of internal function elog_base(), next message will not be logged" + vecho -e " ${BAD}*${NORMAL} Invalid use of internal function elog_base(), next message will not be logged" return 1 ;; esac diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index df85d4db2..6d6425cb7 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -25,45 +25,50 @@ install_qa_check() { declare -i UNSAFE=0 for i in $(find "${D}/" -type f -perm -2002); do ((UNSAFE++)) - echo "UNSAFE SetGID: $i" + vecho "UNSAFE SetGID: $i" chmod -s,o-w "$i" done for i in $(find "${D}/" -type f -perm -4002); do ((UNSAFE++)) - echo "UNSAFE SetUID: $i" + vecho "UNSAFE SetUID: $i" chmod -s,o-w "$i" done # Now we look for all world writable files. for i in $(find "${D}/" -type f -perm -2); do - echo -ne '\a' - echo "QA Security Notice:" - echo "- ${i:${#D}:${#i}} will be a world writable file." - echo "- This may or may not be a security problem, most of the time it is one." - echo "- Please double check that $PF really needs a world writeable bit and file bugs accordingly." + vecho -ne '\a' + vecho "QA Security Notice:" + vecho "- ${i:${#D}:${#i}} will be a world writable file." + vecho "- This may or may not be a security problem, most of the time it is one." + vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly." sleep 1 done if type -p scanelf > /dev/null ; then - local qa_var insecure_rpath=0 - + local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET} + + # display warnings when using stricter because we die afterwards + if has stricter ${FEATURES}; then + unset PORTAGE_QUIET + fi + # Make sure we disallow insecure RUNPATH/RPATH's # Don't want paths that point to the tree where the package was built # (older, broken libtools would do this). Also check for null paths # because the loader will search $PWD when it finds null paths. f=$(scanelf -qyRF '%r %p' "${D}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )") if [[ -n ${f} ]] ; then - echo -ne '\a\n' - echo "QA Notice: the following files contain insecure RUNPATH's" - echo " Please file a bug about this at http://bugs.gentoo.org/" - echo " with the maintaining herd of the package." - echo " Summary: $CATEGORY/$PN: insecure RPATH ${f}" - echo "${f}" - echo -ne '\a\n' + 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 " Summary: $CATEGORY/$PN: insecure RPATH ${f}" + vecho "${f}" + vecho -ne '\a\n' if has stricter ${FEATURES}; then insecure_rpath=1 else - echo "Auto fixing rpaths for ${f}" + vecho "Auto fixing rpaths for ${f}" TMPDIR=${PORTAGE_BUILDDIR} scanelf -BXr ${f} -o /dev/null fi fi @@ -71,12 +76,12 @@ install_qa_check() { # Check for setid binaries but are not built with BIND_NOW f=$(scanelf -qyRF '%b %p' "${D}") if [[ -n ${f} ]] ; then - echo -ne '\a\n' - echo "QA Notice: the following files are setXid, dyn linked, and using lazy bindings" - echo " This combination is generally discouraged. Try re-emerging the package:" - echo " LDFLAGS='-Wl,-z,now' emerge ${PN}" - echo "${f}" - echo -ne '\a\n' + 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}" + vecho -ne '\a\n' die_msg="${die_msg} setXid lazy bindings," sleep 1 fi @@ -99,17 +104,17 @@ install_qa_check() { done if [[ -n ${f} ]] ; then scanelf -qyRF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log - echo -ne '\a\n' - echo "QA Notice: the following files contain runtime text relocations" - echo " Text relocations force the dynamic linker to perform extra" - echo " work at startup, waste system resources, and may pose a security" - echo " risk. On some architectures, the code may not even function" - echo " properly, if at all." - echo " For more information, see http://hardened.gentoo.org/pic-fix-guide.xml" - echo " Please include this file in your report:" - echo " ${T}/scanelf-textrel.log" - echo "${f[@]}" - echo -ne '\a\n' + 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[@]}" + vecho -ne '\a\n' die_msg="${die_msg} textrels," sleep 1 fi @@ -147,16 +152,16 @@ install_qa_check() { if [[ -n ${f} ]] ; then # One more pass to help devs track down the source scanelf -qyRF '%e %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-execstack.log - echo -ne '\a\n' - echo "QA Notice: the following files contain executable stacks" - echo " Files with executable stacks will not work properly (or at all!)" - echo " on some architectures/operating systems. A bug should be filed" - echo " at http://bugs.gentoo.org/ to make sure the file is fixed." - echo " For more information, see http://hardened.gentoo.org/gnu-stack.xml" - echo " Please include this file in your report:" - echo " ${T}/scanelf-execstack.log" - echo "${f}" - echo -ne '\a\n' + 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}" + vecho -ne '\a\n' die_msg="${die_msg} execstacks" sleep 1 fi @@ -169,6 +174,8 @@ install_qa_check() { elif [[ ${die_msg} != "" ]] && has stricter ${FEATURES} && ! has stricter ${RESTRICT} ; then die "Aborting due to QA concerns: ${die_msg}" fi + + PORTAGE_QUIET=${tmp_quiet} fi if [[ ${UNSAFE} > 0 ]] ; then @@ -287,23 +294,23 @@ preinst_suid_scan() { # total suid control. if hasq suidctl $FEATURES; then sfconf=/etc/portage/suidctl.conf - echo ">>> Preforming suid scan in ${IMAGE}" + vecho ">>> Preforming suid scan in ${IMAGE}" for i in $(find ${IMAGE}/ -type f \( -perm -4000 -o -perm -2000 \) ); do if [ -s "${sfconf}" ]; then suid="$(grep ^${i/${IMAGE}/}$ ${sfconf})" if [ "${suid}" = "${i/${IMAGE}/}" ]; then - echo "- ${i/${IMAGE}/} is an approved suid file" + vecho "- ${i/${IMAGE}/} is an approved suid file" else - echo ">>> Removing sbit on non registered ${i/${IMAGE}/}" + vecho ">>> Removing sbit on non registered ${i/${IMAGE}/}" for x in 5 4 3 2 1 0; do echo -ne "\a"; sleep 0.25 ; done - echo -ne "\a" + vecho -ne "\a" chmod ugo-s "${i}" grep ^#${i/${IMAGE}/}$ ${sfconf} > /dev/null || { # sandbox prevents us from writing directly # to files outside of the sandbox, but this # can easly be bypassed using the addwrite() function addwrite "${sfconf}" - echo ">>> Appending commented out entry to ${sfconf} for ${PF}" + vecho ">>> Appending commented out entry to ${sfconf} for ${PF}" ls_ret=$(ls -ldh "${i}") echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf} echo "#${i/${IMAGE}/}" >> ${sfconf} @@ -312,7 +319,7 @@ preinst_suid_scan() { } fi else - echo "suidctl feature set but you are lacking a ${sfconf}" + vecho "suidctl feature set but you are lacking a ${sfconf}" fi done fi @@ -328,7 +335,7 @@ preinst_selinux_labels() { # only attempt to label if setfiles is executable # and 'context' is available on selinuxfs. if [ -f /selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then - echo ">>> Setting SELinux security labels" + vecho ">>> Setting SELinux security labels" ( eval "$(/usr/sbin/selinuxconfig)" || \ die "Failed to determine SELinux policy paths."; @@ -340,7 +347,7 @@ preinst_selinux_labels() { else # nonfatal, since merging can happen outside a SE kernel # like during a recovery situation - echo "!!! Unable to set SELinux security labels" + vecho "!!! Unable to set SELinux security labels" fi fi } @@ -362,7 +369,7 @@ dyn_package() { fi mv -f "${pkg_tmp}" "${pkg_dest}" || die "Failed to move tbz2 to ${pkg_dest}" ln -sf "../All/${PF}.tbz2" "${PKGDIR}/${CATEGORY}/${PF}.tbz2" || die "Failed to create symlink in ${PKGDIR}/${CATEGORY}" - echo ">>> Done." + vecho ">>> Done." cd "${PORTAGE_BUILDDIR}" touch .packaged || die "Failed to 'touch .packaged' in ${PORTAGE_BUILDDIR}" } diff --git a/bin/prepall b/bin/prepall index b1dee558e..74570e6e2 100755 --- a/bin/prepall +++ b/bin/prepall @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: prepall 2230 2005-11-01 01:35:59Z vapier $ +source /usr/lib/portage/bin/isolated-functions.sh + prepallman prepallinfo prepallstrip @@ -19,7 +21,7 @@ for i in "${D}"opt/*/lib{,32,64} \ [[ ! -e ${j} ]] && continue [[ -L ${j} ]] && continue [[ -x ${j} ]] && continue - echo "making executable: /${j/${D}/}" + vecho "making executable: /${j/${D}/}" chmod +x "${j}" done @@ -27,7 +29,7 @@ for i in "${D}"opt/*/lib{,32,64} \ [[ ! -e ${j} ]] && continue [[ -L ${j} ]] && continue [[ ! -x ${j} ]] && continue - echo "removing executable bit: /${j/${D}/}" + vecho "removing executable bit: /${j/${D}/}" chmod -x "${j}" done done @@ -41,7 +43,7 @@ for a in "${D}"usr/lib*/*.a ; do if [[ ! -e ${s} ]] ; then s=${s%usr/*}${s##*/usr/} if [[ -e ${s} ]] ; then - echo -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a" + vecho -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a" sleep 1 fi fi @@ -50,8 +52,8 @@ done # Make sure people don't store libtool files or static libs in /lib f=$(ls "${D}"lib*/*.{a,la} 2>/dev/null) if [[ -n ${f} ]] ; then - echo -e "\n\aQA Notice: excessive files found in the / partition\a" - echo "${f}" + vecho -e "\n\aQA Notice: excessive files found in the / partition\a" + vecho "${f}" sleep 1 fi @@ -59,7 +61,7 @@ fi for a in "${D}"usr/lib*/*.la ; do s=${a##*/} if grep -qs "${D}" "${a}" ; then - echo -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a" + vecho -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a" sleep 1 fi done @@ -70,17 +72,17 @@ if type -p scanelf > /dev/null ; then for d in "${D}"lib* "${D}"usr/lib* ; do f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }') if [[ -n ${f} ]] ; then - echo -e "\n\aQA Notice: the following shared libraries lack a SONAME\a" - echo "${f}" - echo + vecho -e "\n\aQA Notice: the following shared libraries lack a SONAME\a" + vecho "${f}" + vecho sleep 1 fi f=$(scanelf -ByF '%n %p' "${d}"/lib*.so* | gawk '$2 == "" { print }') if [[ -n ${f} ]] ; then - echo -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a" - echo "${f}" - echo + vecho -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a" + vecho "${f}" + vecho sleep 1 fi done diff --git a/bin/prepalldocs b/bin/prepalldocs index 16bd4901a..a2c4e76e5 100755 --- a/bin/prepalldocs +++ b/bin/prepalldocs @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.6 2004/10/04 13:56:50 vapier Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + z="$(find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null)" for y in ${z} ; do @@ -18,15 +20,15 @@ for y in ${z} ; do mylink="${mylink}.gz" fi - echo "fixing doc symlink: ${mylink##*/}" + vecho "fixing doc symlink: ${mylink##*/}" ln -snf "${linkto}" "${mylink}" if [ "${y}" != "${mylink}" ] ; then - echo "removing old symlink: ${y##*/}" + vecho "removing old symlink: ${y##*/}" rm -f "${y}" fi else if [ "${y##*.}" != "gz" ] ; then - echo "gzipping doc: ${y##*/}" + vecho "gzipping doc: ${y##*/}" gzip -f -9 "${y}" fi fi diff --git a/bin/prepallinfo b/bin/prepallinfo index b67a3bb38..268d090df 100755 --- a/bin/prepallinfo +++ b/bin/prepallinfo @@ -3,7 +3,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.6 2004/10/04 13:56:50 vapier Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + [[ ! -d ${D}usr/share/info ]] && exit 0 -echo "info:" +vecho "info:" exec prepinfo diff --git a/bin/prepallman b/bin/prepallman index e02b5ba3d..582f4003f 100755 --- a/bin/prepallman +++ b/bin/prepallman @@ -3,9 +3,11 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepallman,v 1.10 2004/10/04 13:56:50 vapier Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + ret=0 -echo "man:" +vecho "man:" for x in "${D}"opt/*/man "${D}"usr/share/man "${D}"usr/local/man "${D}"usr/X11R6/man ; do if [[ -d ${x} ]] ; then x=${x#${D}} diff --git a/bin/prepinfo b/bin/prepinfo index e2422e760..5863ffd3f 100755 --- a/bin/prepinfo +++ b/bin/prepinfo @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepinfo,v 1.6.2.1 2005/05/29 12:40:08 jstubbs Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [ -z "$1" ] ; then z="${D}usr/share/info" else @@ -30,15 +32,15 @@ for x in $(find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev mylink="${mylink}.gz" fi - echo "fixing GNU info symlink: ${mylink##*/}" + vecho "fixing GNU info symlink: ${mylink##*/}" ln -snf "${linkto}" "${mylink}" if [ "${x}" != "${mylink}" ] ; then - echo "removing old symlink: ${x##*/}" + vecho "removing old symlink: ${x##*/}" rm -f "${x}" fi else if [ "${x##*.}" != "gz" ] ; then - echo "gzipping GNU info page: ${x##*/}" + vecho "gzipping GNU info page: ${x##*/}" gzip -f -9 "${x}" fi fi diff --git a/bin/preplib b/bin/preplib index 492f22fc0..b42fb9bae 100755 --- a/bin/preplib +++ b/bin/preplib @@ -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 /usr/lib/portage/bin/isolated-functions.sh + +vecho "QA Notice: Please stop using me, fix your package instead" 1>&2 LIBDIR_VAR="LIBDIR_${ABI}" if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then diff --git a/bin/prepman b/bin/prepman index f81e200b9..ba70a4b8a 100755 --- a/bin/prepman +++ b/bin/prepman @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepman,v 1.10.2.3 2005/05/29 12:40:08 jstubbs Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [[ -z $1 ]] ; then z="${D}usr/share/man" else @@ -10,7 +12,7 @@ else fi if [[ ! -d ${z} ]] ; then - echo "QA Notice: prepman called with non-existent dir '${z#${D}}'" 2>&1 + vecho "QA Notice: prepman called with non-existent dir '${z#${D}}'" 2>&1 exit 0 fi @@ -33,15 +35,15 @@ for x in $(find "${z}"/ -type d 2>/dev/null) ; do mylink="${mylink}.gz" fi - echo "fixing man page symlink: ${mylink##*/}" + vecho "fixing man page symlink: ${mylink##*/}" ln -snf "${linkto}" "${mylink}" if [[ ${y} != "${mylink}" ]] ; then - echo "removing old symlink: ${y##*/}" + vecho "removing old symlink: ${y##*/}" rm -f "${y}" fi else if [[ ${y##*.} != "gz" ]] && [[ ${y##*.} != "bz2" ]] && [[ ! -d ${y} ]] ; then - echo "gzipping man page: ${y##*/}" + vecho "gzipping man page: ${y##*/}" gzip -f -9 "${y}" fi fi diff --git a/bin/prepstrip b/bin/prepstrip index a837d0a17..44b6b519e 100755 --- a/bin/prepstrip +++ b/bin/prepstrip @@ -3,6 +3,8 @@ # Distributed under the terms of the GNU General Public License v2 # $Id: /var/cvsroot/gentoo-src/portage/bin/prepstrip,v 1.23.2.3 2005/08/15 02:58:20 vapier Exp $ +source /usr/lib/portage/bin/isolated-functions.sh + if [[ " ${FEATURES} " == *" nostrip "* ]] || \ [[ " ${RESTRICT} " == *" nostrip "* ]] || \ [[ " ${RESTRICT} " == *" strip "* ]] @@ -46,7 +48,7 @@ save_elf_debug() { for x in $(scanelf -yRBF%F "$@") $(for y in "$@"; do find "${y}" -type f -name '*.a' -print0 ; done); do if [[ ${banner} -eq 1 ]] ; then - echo "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}" + vecho "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}" banner=0 fi @@ -64,11 +66,11 @@ for x in $(scanelf -yRBF%F "$@") $(for y in "$@"; do find "${y}" -type f -name ' set +o noglob if [[ ${f} == *"current ar archive"* ]] ; then - echo " ${x:${#D}:${#x}}" + vecho " ${x:${#D}:${#x}}" [[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}" fi if [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then - echo " ${x:${#D}:${#x}}" + vecho " ${x:${#D}:${#x}}" save_elf_debug "${x}" [[ ${stripitbaby} -eq 1 ]] && ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}" fi -- 2.26.2