summaryrefslogtreecommitdiffstats
path: root/bin/isolated-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-25 08:15:32 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-25 08:15:32 +0000
commitce40418daeeeabc86ec21b31b5fa48ccf9ebdfa8 (patch)
treee3501812e3e262fcb499cc4f76639cd7050d8e96 /bin/isolated-functions.sh
parentd952f5251f5033a57d95425df7c570b72821033f (diff)
downloadportage-ce40418daeeeabc86ec21b31b5fa48ccf9ebdfa8.tar.gz
portage-ce40418daeeeabc86ec21b31b5fa48ccf9ebdfa8.tar.bz2
portage-ce40418daeeeabc86ec21b31b5fa48ccf9ebdfa8.zip
The qa_call() function and anything before it are portage internals
that the user will not be interested in. Therefore, the stack trace should only show calls that come after qa_call(). svn path=/main/trunk/; revision=8653
Diffstat (limited to 'bin/isolated-functions.sh')
-rwxr-xr-xbin/isolated-functions.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 673f1ad85..d24e42e2f 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -20,8 +20,18 @@ dump_trace() {
declare -i strip=${1:-1}
local filespacing=$2 linespacing=$3
+ # The qa_call() function and anything before it are portage internals
+ # that the user will not be interested in. Therefore, the stack trace
+ # should only show calls that come after qa_call().
+ (( n = ${#FUNCNAME[@]} - 1 ))
+ while (( n > 0 )) ; do
+ [ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+ (( n-- ))
+ done
+ (( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 ))
+
eerror "Call stack:"
- for (( n = ${#FUNCNAME[@]} - 1, p = ${#BASH_ARGV[@]} ; n > ${strip} ; n-- )) ; do
+ for (( p = ${#BASH_ARGV[@]} ; n > ${strip} ; n-- )) ; do
funcname=${FUNCNAME[${n} - 1]}
sourcefile=$(basename ${BASH_SOURCE[${n}]})
lineno=${BASH_LINENO[${n} - 1]}