summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-11-10 13:54:39 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-11-10 13:54:39 +0100
commit2b0d36b249a7d3c0daefef18468c052b969c61fd (patch)
tree5e2010520285b857ba74c4b2b594ba757c0dc687
parent1bc04b995a0ad2ae1bcaf1c8147842bbec2f5d45 (diff)
temporary woraround for broken array indirection
-rw-r--r--README3
-rwxr-xr-xsrc/fifa.sh16
2 files changed, 14 insertions, 5 deletions
diff --git a/README b/README
index 681fd8d..f3b7973 100644
--- a/README
+++ b/README
@@ -88,6 +88,9 @@ You can specify a core procedure on the command line by specifying
'<module_name>/<procedure_name>'
+If you want to do debugging, just call the debug function and export DEBUG=1
+before calling the scripts.
+
Much of the code in the core module is taken (and modified) from the 'real' arch linux install
scripts code. (/arch/setup and /arch/quickinst). the modifications are mostly done
to make the code more (re)useable and to separate backend code, user
diff --git a/src/fifa.sh b/src/fifa.sh
index c8bb712..1664b3c 100755
--- a/src/fifa.sh
+++ b/src/fifa.sh
@@ -131,15 +131,21 @@ execute ()
log "******* Executing phase $2"
exit_var=exit_$object
read $exit_var <<< 0
- debug "\$1: $1, \$2: $2, \$object: $object, \$exit_$object: $exit_object"
- debug "declare: `declare | grep -e "^${object}=" | cut -d"=" -f 2-`"
-
+ # TODO: for some reason the hack below does not work (tested in virtualbox), even though it really should. Someday I must get indirect array variables working and clean this up...
+ # debug "\$1: $1, \$2: $2, \$object: $object, \$exit_$object: $exit_object"
+ # debug "declare: `declare | grep -e "^${object}=" | cut -d"=" -f 2-`"
# props to jedinerd at #bash for this hack.
- eval phase=$(declare | grep -e "^${object}=" | cut -d"=" -f 2-)
- debug "\$phase: $phase - ${phase[@]}"
+ # eval phase=$(declare | grep -e "^${object}=" | cut -d"=" -f 2-)
+ #debug "\$phase: $phase - ${phase[@]}"
+ unset phase
+ [ "$2" = preparation ] && phase=( "${phase_preparation[@]}" )
+ [ "$2" = basics ] && phase=( "${phase_basics[@]}" )
+ [ "$2" = system ] && phase=( "${phase_system[@]}" )
+ [ "$2" = finish ] && phase=( "${phase_finish[@]}" )
# worker_str contains the name of the worker and optionally any arguments
for worker_str in "${phase[@]}"
do
+ debug "Loop iteration. \$worker_str: $worker_str"
execute worker $worker_str || read $exit_var <<< $? # assign last failing exit code to exit_phase_<phasename>, if any.
done
ret=${!exit_var}