From c24cf52ce4218f2be3cc5e4e2bc4464e55827d25 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Thu, 30 Sep 2010 19:08:51 +0200
Subject: [PATCH] seperate loading from execution

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist-build-explorer | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/bin/cdist-build-explorer b/bin/cdist-build-explorer
index a1f5277e..1ccc9df7 100755
--- a/bin/cdist-build-explorer
+++ b/bin/cdist-build-explorer
@@ -23,12 +23,17 @@
 
 find "${CDIST_LIBDIR}" -type f -name cdist_explore\*.sh > "${CDIST_TMP}"
 
+# first load all functions
 while read funcfull; do
    sh="${funcfull##*/}"
    func="${sh%.sh}"
    var="__$func"
 
    cat "${funcfull}"
+done < "${CDIST_TMP}"
+
+# then execute functions
+while read funcfull; do
    echo "$var=\"\$($func)\""
    echo "echo $var=\\\"\$$var\\\""
 done < "${CDIST_TMP}"