diff options
author | Brian Harring <ferringb@gentoo.org> | 2006-01-23 07:48:45 +0000 |
---|---|---|
committer | Brian Harring <ferringb@gentoo.org> | 2006-01-23 07:48:45 +0000 |
commit | 78d58ed662329886283547e7681e9384bf8cc867 (patch) | |
tree | d520027eb919a492cadc9491065e2f322aeb4ed6 | |
parent | b065f756bdc951a2ad6f69c6cedf475dd2846013 (diff) | |
download | portage-78d58ed662329886283547e7681e9384bf8cc867.tar.gz portage-78d58ed662329886283547e7681e9384bf8cc867.tar.bz2 portage-78d58ed662329886283547e7681e9384bf8cc867.zip |
bash tracebacks. :)
svn path=/main/trunk/; revision=2572
-rwxr-xr-x | bin/ebuild.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index afd0343c2..5334abdf4 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -272,7 +272,7 @@ diefunc() { shift 3 echo >&2 echo "!!! ERROR: $CATEGORY/$PF failed." >&2 - echo "!!! Function $funcname, Line $lineno, Exitcode $exitcode" >&2 + dump_trace 2 1>&2 echo "!!! ${*:-(no error message)}" >&2 echo "!!! If you need support, post the topmost build error, NOT this status message." >&2 echo >&2 @@ -284,6 +284,22 @@ diefunc() { exit 1 } +dump_trace() { + local skip funcname sourcefile lineno + if [[ -n $1 ]]; then + declare -i skip=$1 + else + skip=1 + fi + echo "Call stack:" + for (( n = $skip ; n < ${#FUNCNAME[@]} ; ++n )) ; do + funcname=${FUNCNAME[${n}]} + sourcefile=$(basename ${BASH_SOURCE[$(( n - 1 ))]}) + lineno=${BASH_LINENO[$(( n - 1 ))]} + echo " File ${sourcefile}, line ${lineno}, in ${funcname}" + done +} + #if no perms are specified, dirs/files will have decent defaults #(not secretive, but not stupid) umask 022 |