1 |
commit: 4973cc7e046d24c33a53eb14218f43d9e5031876 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 30 22:19:13 2011 +0000 |
4 |
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 30 22:19:13 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4973cc7e |
7 |
|
8 |
isolated-functions.sh: fix syntax error for die |
9 |
|
10 |
Fix die so that dump_trace is not called when the main script is a |
11 |
helper binary. This prevents the following error message when a helper |
12 |
dies automatically in EAPI 4: |
13 |
|
14 |
isolated-functions.sh: line 61: p -= : syntax error: operand expected (error token is "-= ") |
15 |
|
16 |
--- |
17 |
bin/isolated-functions.sh | 6 ++++-- |
18 |
1 files changed, 4 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh |
21 |
index 1403c0a..8af202f 100644 |
22 |
--- a/bin/isolated-functions.sh |
23 |
+++ b/bin/isolated-functions.sh |
24 |
@@ -139,8 +139,10 @@ die() { |
25 |
eerror "ERROR: $CATEGORY/$PF failed:" |
26 |
eerror " ${*:-(no error message)}" |
27 |
eerror |
28 |
- # This part is useless when called by the die helper. |
29 |
- if [[ ${BASH_SOURCE[1]##*/} != die ]] ; then |
30 |
+ # dump_trace is useless when the main script is a helper binary |
31 |
+ local main_index |
32 |
+ (( main_index = ${#BASH_SOURCE[@]} - 1 )) |
33 |
+ if has ${BASH_SOURCE[$main_index]##*/} ebuild.sh misc-functions.sh ; then |
34 |
dump_trace 2 ${filespacing} ${linespacing} |
35 |
eerror " $(printf "%${filespacing}s" "${BASH_SOURCE[1]##*/}"), line $(printf "%${linespacing}s" "${BASH_LINENO[0]}"): Called die" |
36 |
eerror "The specific snippet of code:" |