summaryrefslogtreecommitdiffstats
path: root/bin/isolated-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-01-31 08:06:18 +0000
committerZac Medico <zmedico@gentoo.org>2008-01-31 08:06:18 +0000
commit71766d5ef79dcc9068cf7df8de30e34d83247158 (patch)
tree5a8a93f6f7b0b5c58d917da7abaea124e5ebbd8c /bin/isolated-functions.sh
parent6b2bd7703e5416f33c5d62584d691252884b9382 (diff)
downloadportage-71766d5ef79dcc9068cf7df8de30e34d83247158.tar.gz
portage-71766d5ef79dcc9068cf7df8de30e34d83247158.tar.bz2
portage-71766d5ef79dcc9068cf7df8de30e34d83247158.zip
Replace the current diefunc() and die alias with a single die() function.
The previous arguments to diefunc() weren't used anyway. The result is that the die message looks better because it doesn't show the alias and all of it's arguments which are totally irrelevant. (trunk r9215:9217) svn path=/main/branches/2.1.2/; revision=9245
Diffstat (limited to 'bin/isolated-functions.sh')
-rw-r--r--bin/isolated-functions.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 7228cbd77..7e7e710e0 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -5,8 +5,7 @@
# We need this next line for "die" and "assert". It expands
# It _must_ preceed all the calls to die and assert.
shopt -s expand_aliases
-alias die='diefunc "$FUNCNAME" "$LINENO" "$?"'
-alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
+alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || die'
alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"'
alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi'
@@ -48,9 +47,7 @@ dump_trace() {
done
}
-diefunc() {
- local funcname="$1" lineno="$2" exitcode="$3"
- shift 3
+die() {
if [ -n "${QA_INTERCEPTORS}" ] ; then
# die was called from inside inherit. We need to clean up
# QA_INTERCEPTORS since sed is called below.
@@ -139,6 +136,12 @@ diefunc() {
exit 1
}
+# We need to implement diefunc() since environment.bz2 files contain
+# calls to it (due to alias expansion).
+diefunc() {
+ die "${@}"
+}
+
quiet_mode() {
[[ ${PORTAGE_QUIET} -eq 1 ]]
}
@@ -437,7 +440,7 @@ save_ebuild_env() {
# There's no need to bloat environment.bz2 with internally defined
# functions and variables, so filter them out if possible.
- unset -f dump_trace diefunc quiet_mode vecho elog_base eqawarn elog \
+ unset -f dump_trace die diefunc quiet_mode vecho elog_base eqawarn elog \
esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
hasv hasq qa_source qa_call addread addwrite adddeny addpredict \