aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-05 21:22:08 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-05 21:22:08 +0000
commit8ab6871c8f84f7420fb2589adaa5668045c06dfa (patch)
treec189d841fa3feb916aacced998e62bcefb6099d6
parentbafd10fbdbf100e687940848400e07f9923da4cd (diff)
downloadpaludis-8ab6871c8f84f7420fb2589adaa5668045c06dfa.tar.gz
paludis-8ab6871c8f84f7420fb2589adaa5668045c06dfa.tar.xz
Add eselect style backtraces to die
-rwxr-xr-xebuild/ebuild.bash11
1 files changed, 10 insertions, 1 deletions
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index 2a5e1ad..d30a722 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -47,11 +47,20 @@ diefunc()
local func="$1" line="$2"
shift 2
echo 1>&2
- echo "ERROR in ${CATEGORY:-?}/${PF:-?}:" 1>&2
+ echo "!!! ERROR in ${CATEGORY:-?}/${PF:-?}:" 1>&2
echo "!!! In ${func:-?} at line ${line:-?}" 1>&2
echo "!!! ${*:-(no message provided)}" 1>&2
echo 1>&2
+ echo "!!! Call stack:" 1>&2
+ for (( n = 1 ; n < ${#FUNCNAME[@]} ; ++n )) ; do
+ funcname=${FUNCNAME[${n}]}
+ sourcefile=$(basename ${BASH_SOURCE[${n}]})
+ lineno=${BASH_LINENO[$(( n - 1 ))]}
+ echo "!!! * ${funcname} (${sourcefile}:${lineno})" 1>&2
+ done
+ echo 1>&2
+
kill ${EBUILD_KILL_PID}
exit 249
}