# HG changeset patch # User "Yann E. MORIN" # Date 1217064162 0 # Node ID 8b628f8dc108ad4e5666c1369b8671fa219314f3 # Parent d2c46e039cd8396adfdb569af038373ca8fbb269 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(+) diff -r d2c46e039cd8 -r 8b628f8dc108 scripts/functions --- a/scripts/functions Fri Jul 25 22:57:35 2008 +0000 +++ b/scripts/functions Sat Jul 26 09:22:42 2008 +0000 @@ -5,6 +5,8 @@ # Prepare the fault handler CT_OnError() { ret=$? + # Bail out early in subshell, the upper level shell will act accordingly. + [ ${BASH_SUBSHELL} -eq 0 ] || exit $ret CT_DoLog ERROR "Build failed in step '${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}'" for((step=(CT_STEP_COUNT-1); step>1; step--)); do CT_DoLog ERROR " called in step '${CT_STEP_MESSAGE[${step}]}'"