summaryrefslogtreecommitdiff
path: root/src/core/libs
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2011-01-02 18:12:56 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2011-01-02 18:12:56 +0100
commitf3c4fa96ef3bf1e41309c9e618837043a34dafe9 (patch)
tree4747e5458520821cf9c48bb944dde7d5254a7f3d /src/core/libs
parente43e4d55208a2d2e52bca873d7eae932e0d10e95 (diff)
Use local vars in execute ()
By using local variables, we prevent getting cwd's and object names getting mixed up during recursive calls. This fixes the configure_system worker not being registered as having run successfully, and preventing the user from going to the install bootloader step in the interactive procedure.
Diffstat (limited to 'src/core/libs')
-rwxr-xr-xsrc/core/libs/lib-flowcontrol.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/libs/lib-flowcontrol.sh b/src/core/libs/lib-flowcontrol.sh
index e4d3df1..b9830b0 100755
--- a/src/core/libs/lib-flowcontrol.sh
+++ b/src/core/libs/lib-flowcontrol.sh
@@ -91,8 +91,8 @@ execute ()
{
[ -z "$1" -o -z "$2" ] && debug 'MAIN' "execute $@" && die_error "Use the execute function like this: execute <type> <name> with type=phase/worker"
[ "$1" != phase -a "$1" != worker ] && debug 'MAIN' "execute $@" && die_error "execute's first argument must be a valid type (phase/worker)"
- PWD_BACKUP=`pwd`
- object=$1_$2
+ local PWD_BACKUP=`pwd`
+ local object=$1_$2
if [ "$1" = worker ]
then
@@ -102,7 +102,7 @@ execute ()
shift 2
$object "$@"
local ret=$?
- exit_var=exit_$object
+ local exit_var=exit_$object
read $exit_var <<< $ret # maintain exit status of each worker
else
die_error "$object is not defined!"
@@ -110,7 +110,7 @@ execute ()
elif [ "$1" = phase ]
then
log "******* Executing phase $2"
- exit_var=exit_$object
+ local exit_var=exit_$object
read $exit_var <<< 0
# 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 'MAIN' "\$1: $1, \$2: $2, \$object: $object, \$exit_$object: $exit_object"