summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-10 11:09:35 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-10 11:09:35 +0100
commita9e1eb66bc349a9ec4bf65e416d33e803fa6cfd1 (patch)
treed7882ad1ef0bde9e4072a237a7acf9a1656edf4e
parentdd586806b2c9394e6136d5523334ac89d7d49ce8 (diff)
added -bit overdue- debugging function + added debugging for phase execution regression
-rwxr-xr-xsrc/fifa.sh15
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