seperate loading from execution

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2010-09-30 19:08:51 +02:00
parent 9813c38657
commit c24cf52ce4

View file

@ -23,12 +23,17 @@
find "${CDIST_LIBDIR}" -type f -name cdist_explore\*.sh > "${CDIST_TMP}" find "${CDIST_LIBDIR}" -type f -name cdist_explore\*.sh > "${CDIST_TMP}"
# first load all functions
while read funcfull; do while read funcfull; do
sh="${funcfull##*/}" sh="${funcfull##*/}"
func="${sh%.sh}" func="${sh%.sh}"
var="__$func" var="__$func"
cat "${funcfull}" cat "${funcfull}"
done < "${CDIST_TMP}"
# then execute functions
while read funcfull; do
echo "$var=\"\$($func)\"" echo "$var=\"\$($func)\""
echo "echo $var=\\\"\$$var\\\"" echo "echo $var=\\\"\$$var\\\""
done < "${CDIST_TMP}" done < "${CDIST_TMP}"