summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2002-03-27 18:33:23 +0000
committerDan Armak <danarmak@gentoo.org>2002-03-27 18:33:23 +0000
commitffeb88777b0abe3673ceba2af9643057b7fb7ecc (patch)
treea7405a4614f5a555589340b0ce4c7baa0f67f11d /eclass/debug.eclass
parent*** empty log message *** (diff)
downloadhistorical-ffeb88777b0abe3673ceba2af9643057b7fb7ecc.tar.gz
historical-ffeb88777b0abe3673ceba2af9643057b7fb7ecc.tar.bz2
historical-ffeb88777b0abe3673ceba2af9643057b7fb7ecc.zip
*** empty log message ***
Diffstat (limited to 'eclass/debug.eclass')
-rw-r--r--eclass/debug.eclass50
1 files changed, 50 insertions, 0 deletions
diff --git a/eclass/debug.eclass b/eclass/debug.eclass
new file mode 100644
index 000000000000..a4b9aed3ba2c
--- /dev/null
+++ b/eclass/debug.eclass
@@ -0,0 +1,50 @@
+# 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.12 2002/03/27 18:33:23 danarmak Exp $
+# This provides functions for verbose output for debugging
+
+# 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="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() {
+
+ while [ "$1" ]; do
+
+ # 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
+ [ -d "$BUILD_PREFIX/$P/temp" ] && echo $1 >> ${T}/eclass-debug.log
+
+ shift
+ done
+
+}
+
+# std message functions
+
+debug-print-function() {
+
+ str="$1: entering function"
+ shift
+ debug-print "$str, parameters: $*"
+
+}
+
+debug-print-section() {
+
+ debug-print "now in section $*"
+
+}
+