From f65c78deb60c7d1703caa99edcbbfb336fd82c3d Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Sun, 19 Sep 2010 14:28:12 +0200
Subject: [PATCH] dynamic load new explorers

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist-config                              |  1 +
 bin/cdist-explore                             | 11 +++++---
 conf/hosts/kr/manifest                        |  6 +++--
 conf/lib/cdist_explore_pkg_system             | 26 +++++++++++++++++++
 .../{cdist_package => cdist_package_install}  |  2 +-
 5 files changed, 39 insertions(+), 7 deletions(-)
 create mode 100755 conf/lib/cdist_explore_pkg_system
 rename conf/lib/{cdist_package => cdist_package_install} (96%)

diff --git a/bin/cdist-config b/bin/cdist-config
index 9bba8b93..fd92ca9d 100755
--- a/bin/cdist-config
+++ b/bin/cdist-config
@@ -26,5 +26,6 @@
 : ${CDIST_LIBDIR:=$CDIST_CONFIG/lib}
 
 
+
 #echo $CDIST_CONFIG
 #echo $CDIST_LIBDIR
diff --git a/bin/cdist-explore b/bin/cdist-explore
index c6a6d529..7a2a3a4e 100755
--- a/bin/cdist-explore
+++ b/bin/cdist-explore
@@ -19,13 +19,16 @@
 #
 #
 
-reports="hostname os"
+#reports="hostname os"
 
 . cdist-config
 
-for report in $reports; do
-   func="cdist_explore_$report"
-   var="__cdist_$report"
+cd ${CDIST_LIBDIR}
+
+for func in cdist_explore_*; do
+   #func="cdist_explore_$report"
+   var="__$func"
+
    . "${CDIST_LIBDIR}/${func}"
    eval $var=\"\$\($func\)\"
    eval echo $var=\\\"\$$var\\\"
diff --git a/conf/hosts/kr/manifest b/conf/hosts/kr/manifest
index 432400af..841578b8 100644
--- a/conf/hosts/kr/manifest
+++ b/conf/hosts/kr/manifest
@@ -1,2 +1,4 @@
-cdist_package --install vim zsh
-cdist_file /etc/issue --source issue
+cdist_package_install vim zsh
+
+#cdist_file /etc/issue --source issue
+#cdist_file /etc/issue --via my_func
diff --git a/conf/lib/cdist_explore_pkg_system b/conf/lib/cdist_explore_pkg_system
new file mode 100755
index 00000000..80151463
--- /dev/null
+++ b/conf/lib/cdist_explore_pkg_system
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# 2010 Nico Schottelius (nico-cdist at schottelius.org)
+#
+# This file is part of cdist.
+#
+# cdist is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# cdist is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with cdist. If not, see <http://www.gnu.org/licenses/>.
+#
+#
+
+cdist_explore_pkg_system()
+{
+#   case $(cdist_explore_os)
+   :
+}
diff --git a/conf/lib/cdist_package b/conf/lib/cdist_package_install
similarity index 96%
rename from conf/lib/cdist_package
rename to conf/lib/cdist_package_install
index d7c1e4c6..3d150ec4 100644
--- a/conf/lib/cdist_package
+++ b/conf/lib/cdist_package_install
@@ -19,7 +19,7 @@
 #
 #
 
-cdist_package()
+cdist_package_install()
 {