Skip to content
Snippets Groups Projects
Commit b616fb68 authored by Christian Engwer's avatar Christian Engwer
Browse files

clean up variables, once they aren't used anymore, so that they don't collide...

clean up variables, once they aren't used anymore, so that they don't collide during nested invocation of dunecontrol

[[Imported from SVN: r5049]]
parent c273ad93
Branches
Tags
No related merge requests found
......@@ -84,7 +84,7 @@ build_modules() {
cd "$path"
eval_control $runcommand $path/$CONTROL
); then echo "--- Failed to build $module ---"; exit 1; fi
echo "--- $module done ---"
eval echo "--- \$NAME_${module} done ---"
done
}
......@@ -311,10 +311,10 @@ usage () {
# create the module list
create_module_list() {
find_modules_in_path
if test "x$MODULE" = "x"; then
sort_modules $MODULES
else
if test "x$SEARCH_MODULES" != "x"; then
sort_modules $SEARCH_MODULES
else
sort_modules $MODULES
fi
if test "x$ONLY" != x; then
export MODULES="$ONLY"
......@@ -345,6 +345,11 @@ for i in $COMMANDS; do
export ${COMMAND}_FLAGS=""
done
# clear variables
export SEARCH_MODULES=""
export MODULES=""
export ONLY=""
# parse commandline parameters
while test $# -gt 0; do
# get option
......
......@@ -124,6 +124,9 @@ EOF
# sort $MODULES according to the dependencies
#
sort_modules() {
# reset list
export SORTEDMODULES=""
# handle each modules passed as parameter
for m in "$@"; do
# did we find a module file for this mopdule?
if test "x$(eval echo \$HAVE_$m)" != "x"; then
......@@ -133,7 +136,12 @@ sort_modules() {
exit 1
fi
done
# save result
export MODULES="$SORTEDMODULES"
# clean up temporary variables
for m in $MODULES; do
export SORT_DONE_${m}=""
done
}
#
......@@ -150,7 +158,7 @@ _sort_module() {
echo "ERROR: invalid module name $module" > /dev/stderr
exit 1
fi
if test "x$(eval echo \$SORT_DONE_${command}_${module})" != "xyes"; then
if test "x$(eval echo \$SORT_DONE_${module})" != "xyes"; then
# resolve dependencies
for name in $(eval "echo \$DEPS_$module"); do
dep=$(fix_variable_name $name)
......@@ -184,7 +192,7 @@ _sort_module() {
fi
done
# insert this module into the list
export SORT_DONE_${command}_${module}=yes
export SORT_DONE_${module}=yes
export SORTEDMODULES="$SORTEDMODULES $module"
fi
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment