diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-25 09:09:02 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-25 09:09:02 +0000 |
commit | 62c4fdbc5d7ab789f449d3a3c5cc4c14e51bfbab (patch) | |
tree | 03a016b8e46afb990ddce4e4a119e5b071a4ec10 | |
parent | ac8de8c5fa8c5172adc42eddae540665f9b2b1c4 (diff) | |
download | portage-62c4fdbc5d7ab789f449d3a3c5cc4c14e51bfbab.tar.gz portage-62c4fdbc5d7ab789f449d3a3c5cc4c14e51bfbab.tar.bz2 portage-62c4fdbc5d7ab789f449d3a3c5cc4c14e51bfbab.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(). (trunk r8653)
svn path=/main/branches/2.1.2/; revision=8656
-rw-r--r-- | bin/isolated-functions.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 673f1ad85..d24e42e2f 100644 --- 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]} |