summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2009-10-03 20:41:40 +0000
committerFabian Groffen <grobian@gentoo.org>2009-10-03 20:41:40 +0000
commita7aa7a7381143eeaa30871c2351271cecf130d7b (patch)
tree006fe56ff1e7fc26358c3741e3b916975d4b4ac2
parent0fdef36d3557ea3ee64a8982e66338db2ebbd1f8 (diff)
downloadportage-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.gz
portage-a7aa7a7381143eeaa30871c2351271cecf130d7b.tar.bz2
portage-a7aa7a7381143eeaa30871c2351271cecf130d7b.zip
only calculate spacing width for that part of the stack that we're going to print
svn path=/main/trunk/; revision=14482
-rwxr-xr-xbin/isolated-functions.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index bb9b9a042..9041846d0 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -79,11 +79,18 @@ die() {
fi
local n filespacing=0 linespacing=0
# setup spacing to make output easier to read
- for ((n = ${#FUNCNAME[@]} - 1; n >= 0; --n)); do
+ (( n = ${#FUNCNAME[@]} - 1 ))
+ while (( n > 0 )) ; do
+ [ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+ (( n-- ))
+ done
+ (( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 ))
+ while (( n >= 0 )); do
sourcefile=${BASH_SOURCE[${n}]} sourcefile=${sourcefile##*/}
lineno=${BASH_LINENO[${n}]}
((filespacing < ${#sourcefile})) && filespacing=${#sourcefile}
((linespacing < ${#lineno})) && linespacing=${#lineno}
+ (( n-- ))
done
eerror