diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-01-30 14:19:13 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-02-02 15:21:45 -0800 |
commit | cd9be31a243d550166fbb0ee174a35a22e8c5e15 (patch) | |
tree | 310a56bdae2be0f8d72b21f45c3211700f516703 | |
parent | ab5a8cd10af100be2a0b190fb1ea838035652a16 (diff) | |
download | portage-cd9be31a243d550166fbb0ee174a35a22e8c5e15.tar.gz portage-cd9be31a243d550166fbb0ee174a35a22e8c5e15.tar.bz2 portage-cd9be31a243d550166fbb0ee174a35a22e8c5e15.zip |
isolated-functions.sh: fix syntax error for die
Fix die so that dump_trace is not called when the main script is a
helper binary. This prevents the following error message when a helper
dies automatically in EAPI 4:
isolated-functions.sh: line 61: p -= : syntax error: operand expected (error token is "-= ")
-rw-r--r-- | bin/isolated-functions.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 1403c0aac..8af202f65 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -139,8 +139,10 @@ die() { eerror "ERROR: $CATEGORY/$PF failed:" eerror " ${*:-(no error message)}" eerror - # This part is useless when called by the die helper. - if [[ ${BASH_SOURCE[1]##*/} != die ]] ; then + # dump_trace is useless when the main script is a helper binary + local main_index + (( main_index = ${#BASH_SOURCE[@]} - 1 )) + if has ${BASH_SOURCE[$main_index]##*/} ebuild.sh misc-functions.sh ; then dump_trace 2 ${filespacing} ${linespacing} eerror " $(printf "%${filespacing}s" "${BASH_SOURCE[1]##*/}"), line $(printf "%${linespacing}s" "${BASH_LINENO[0]}"): Called die" eerror "The specific snippet of code:" |