From a9e1eb66bc349a9ec4bf65e416d33e803fa6cfd1 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 10 Nov 2008 11:09:35 +0100 Subject: added -bit overdue- debugging function + added debugging for phase execution regression --- src/fifa.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/fifa.sh b/src/fifa.sh index df6bd76..e201bea 100755 --- a/src/fifa.sh +++ b/src/fifa.sh @@ -37,6 +37,13 @@ log () } +debug () +{ + [ "$DEBUG" = "1" ] && echo -e "[DEBUG] $@" + [ "$DEBUG" = "1" ] && echo -e "[DEBUG] $@" >$LOG +} + + ###### Core functions ###### @@ -124,9 +131,13 @@ execute () log "******* Executing phase $2" exit_var=exit_$object read $exit_var <<< 0 + debug "\$1: $1, \$2: $2, \$object: $object, \$exit_$object: $exit_var" + debug "declare: `declare | grep -e "^${object}=" | cut -d"=" -f 2-`" - eval phase_array=$(declare | grep -e "^${object}=" | cut -d"=" -f 2-) # props to jedinerd at #bash for this hack. - for worker_str in "${phase_array[@]}" # worker_str contains the name of the worker and optionally any arguments + # props to jedinerd at #bash for this hack. + eval phase=$(declare | grep -e "^${object}=" | cut -d"=" -f 2-) + # worker_str contains the name of the worker and optionally any arguments + for worker_str in "${phase[@]}" do execute worker $worker_str || read $exit_var <<< $? # assign last failing exit code to exit_phase_, if any. done -- cgit v1.2.3-54-g00ecf