commit:     b90b4fb30b9f9b0b37c8804d770dcc454fcc6bd1
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 28 17:17:34 2014 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 17:17:34 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/qa-scripts.git;a=commit;h=b90b4fb3

adjust output for use with portage

Adjust output so that things look better when running stand-alone,
by category, or from within portage.

---
 depcheck         | 22 ++++++++++++++--------
 tinderbox/bashrc |  7 +++++--
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/depcheck b/depcheck
index a0b022b..87fdacb 100755
--- a/depcheck
+++ b/depcheck
@@ -69,8 +69,10 @@ check_atom() {
                return
        fi
 
-       einfo Checking ${atom} for undeclared dependencies
-       eindent
+       if [ -z "${INSIDE_PORTAGE}" ]; then
+               einfo Checking ${atom} for undeclared dependencies
+               eindent
+       fi
 
        local obj
        for obj in $objects
@@ -198,8 +200,10 @@ check_atom() {
                ewarn "Suspect RDEPEND: $(bold ${suspect_rdepends})"
        fi
 
-       echo
-       eoutdent
+       if [ -n "${CAT}" ]; then
+               eoutdent
+               echo
+       fi
 
        return $errors
 
@@ -277,8 +281,10 @@ else
        check_package $1
 fi
 
-if [ $? -eq 0 ]; then
-       einfo Checking complete, no errors found
-else
-       eerror Checking complete, errors found
+if [ $DEBUG = TRUE ]; then
+       if [ $? -eq 0 ]; then
+               einfo Checking complete, no errors found
+       else
+               eerror Checking complete, errors found
+       fi
 fi

diff --git a/tinderbox/bashrc b/tinderbox/bashrc
index 560c3fd..8533e2b 100644
--- a/tinderbox/bashrc
+++ b/tinderbox/bashrc
@@ -115,9 +115,12 @@ tinderbox_postinst_checks() {
        fi
 
        if type -P "${DEPCHECK_BIN}" > /dev/null ; then
-               SANDBOX_ON=0 "${DEPCHECK_BIN}" ${PF} > 
"${BUILD_DATA_DIR}"/depcheck
+               SANDBOX_ON=0 INSIDE_PORTAGE=1 "${DEPCHECK_BIN}" ${PF} > 
"${BUILD_DATA_DIR}"/depcheck
                if [[ "${TINDERBOX_VERBOSE}" == true ]] ; then
-                       cat "${BUILD_DATA_DIR}"/depcheck
+                       if [ -f "${BUILD_DATA_DIR}"/depcheck ] && [ -n "$(cat 
"${BUILD_DATA_DIR}"/depcheck)" ] ; then
+                               eqawarn "QA Notice:"
+                               eqawarn "$(cat "${BUILD_DATA_DIR}"/depcheck)"
+                       fi
                fi
        fi
 }

Reply via email to