diff options
author | Dan Armak <danarmak@gentoo.org> | 2002-02-06 20:38:10 +0000 |
---|---|---|
committer | Dan Armak <danarmak@gentoo.org> | 2002-02-06 20:38:10 +0000 |
commit | 15e77ca8e373323bcd0f5da044a7bec387e898be (patch) | |
tree | 35f5b939058cd01e9239fdadb8a99e343581c5e2 /eclass/debug.eclass | |
parent | portage-1.8.9_pre5 fixes a few bugs (diff) | |
download | historical-15e77ca8e373323bcd0f5da044a7bec387e898be.tar.gz historical-15e77ca8e373323bcd0f5da044a7bec387e898be.tar.bz2 historical-15e77ca8e373323bcd0f5da044a7bec387e898be.zip |
major eclass cleanup/restructuring. no change ni inheriting ebuilds necessary. more details shortly in updated docs
and in coming up gentoo-dev post.
Diffstat (limited to 'eclass/debug.eclass')
-rw-r--r-- | eclass/debug.eclass | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/eclass/debug.eclass b/eclass/debug.eclass index 8c70b3ee776b..4823180a48f5 100644 --- a/eclass/debug.eclass +++ b/eclass/debug.eclass @@ -1,28 +1,32 @@ # Copyright 1999-2000 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Author Dan Armak <danarmak@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/eclass/debug.eclass,v 1.7 2001/12/23 14:25:28 danarmak Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/debug.eclass,v 1.8 2002/02/06 20:38:10 danarmak Exp $ # This provides functions for verbose output for debugging -# Note: we check whether these settings are set by "if [ "$FOO" ]; then". -# Therefore set them to true/false only - not yes/no or whatever. - -# redirect output, unset to disable -# use e.g. /dev/stdout. -# todo: add support for logging into a file. +# redirect output, unset to disable. use e.g. /dev/stdout to write into a file/device. +# use special setting "on" to echo the output - unlike above, doesn't violate sandbox. # the test here is to enable people to export DEBUG_OUTPUT before running ebuild/emerge # so that they won't have to edit debug.eclass anymore -[ -n "$ECLASS_DEBUG_OUTPUT" ] || ECLASS_DEBUG_OUTPUT="" +#[ -n "$ECLASS_DEBUG_OUTPUT" ] || ECLASS_DEBUG_OUTPUT="on" # used internally for output # redirects output wherever's needed # in the future might use e* from /etc/init.d/functions.sh if i feel like it debug-print() { - [ -n "$ECLASS_DEBUG_OUTPUT" ] || return 0 - while [ "$1" ]; do - echo "debug: $1" > $ECLASS_DEBUG_OUTPUT + + # extra user-configurable targets + if [ "$ECLASS_DEBUG_OUTPUT" == "on" ]; then + echo "debug: $1" + elif [ -n "$ECLASS_DEBUG_OUTPUT" ]; then + echo "debug: $1" >> $ECLASS_DEBUG_OUTPUT + fi + + # default target + echo $1 >> ${BUILD_PREFIX}/${P}/temp/eclass-debug.log + shift done |