diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-10 11:09:35 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2008-11-10 11:09:35 +0100 |
commit | a9e1eb66bc349a9ec4bf65e416d33e803fa6cfd1 (patch) | |
tree | d7882ad1ef0bde9e4072a237a7acf9a1656edf4e /src | |
parent | dd586806b2c9394e6136d5523334ac89d7d49ce8 (diff) |
added -bit overdue- debugging function + added debugging for phase execution regression
Diffstat (limited to 'src')
-rwxr-xr-x | src/fifa.sh | 15 |
1 files 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_<phasename>, if any. done |