In case of error, the error message would be printing in subshells, thus printing as many error message as there were subshells.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 26 09:22:42 2008 +0000 (2008-07-26)
changeset 7268b628f8dc108
parent 725 d2c46e039cd8
child 727 33c246763c8a
In case of error, the error message would be printing in subshells, thus printing as many error message as there were subshells.
Limit printing this message only in the top-level shell.

/trunk/scripts/functions | 2 2 0 0 ++
1 file changed, 2 insertions(+)
scripts/functions
     1.1 --- a/scripts/functions	Fri Jul 25 22:57:35 2008 +0000
     1.2 +++ b/scripts/functions	Sat Jul 26 09:22:42 2008 +0000
     1.3 @@ -5,6 +5,8 @@
     1.4  # Prepare the fault handler
     1.5  CT_OnError() {
     1.6      ret=$?
     1.7 +    # Bail out early in subshell, the upper level shell will act accordingly.
     1.8 +    [ ${BASH_SUBSHELL} -eq 0 ] || exit $ret
     1.9      CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'"
    1.10      for((step=(CT_STEP_COUNT-1); step>1; step--)); do
    1.11          CT_DoLog ERROR "      called in step '${CT_STEP_MESSAGE[${step}]}'"