From 756a12c4f0c2bcc5fab1aa7d3323a5c9fbb83e49 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Wed, 23 Feb 2011 09:10:17 +0100
Subject: [PATCH 1/5] remove failing objects from initial manifest

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 conf/manifests/init | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/conf/manifests/init b/conf/manifests/init
index fff86664..20714bad 100755
--- a/conf/manifests/init
+++ b/conf/manifests/init
@@ -10,8 +10,7 @@
 case "$__cdist_target_host" in
    localhost)
       __issue iddoesnotmatterhere
-      __package qemu-kvm --wtf installed
-      __package tftpd-hpa --fancyoption installed
+      __file test --type file --destination /tmp/cdist-testfile
    ;;
 
    icarus)

From 9a3d3bf48957d1aa0ef8948dc6e0ce2e1a31237f Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Wed, 23 Feb 2011 09:17:33 +0100
Subject: [PATCH 2/5] s/opt_file/optional/

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist_tree_wrapper | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/cdist_tree_wrapper b/bin/cdist_tree_wrapper
index 64229efe..80ec3809 100755
--- a/bin/cdist_tree_wrapper
+++ b/bin/cdist_tree_wrapper
@@ -82,7 +82,7 @@ done < "$(__cdist_type_param_file "$__cdist_type" "$__cdist_name_type_params_req
 
 # Allow optional parameters
 while read optional; do
-   if [ -f "${tempparams}/${opt_file}" ]; then
+   if [ -f "${tempparams}/${optional}" ]; then
       mv "${tempparams}/${optional}" "${__cdist_ddir}"
    fi
 done < "$(__cdist_type_param_file "$__cdist_type" "$__cdist_name_type_params_optional")"

From bf94bd1aabb9ba7d49f5537c2cff59f4c81409de Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Wed, 23 Feb 2011 09:20:34 +0100
Subject: [PATCH 3/5] no need to export variables

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist_tree_wrapper | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/bin/cdist_tree_wrapper b/bin/cdist_tree_wrapper
index 80ec3809..c33934e9 100755
--- a/bin/cdist_tree_wrapper
+++ b/bin/cdist_tree_wrapper
@@ -25,13 +25,11 @@
 #
 
 . cdist-config
-
 [ $# -ge 1 ] || __cdist_usage "<id> <options>"
-
 set -eu
 
-export __cdist_object_id="$1"; shift
-export __cdist_type="$__cdist_myname"
+__cdist_object_id="$1"; shift
+__cdist_type="$__cdist_myname"
 
 echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \
    __cdist_usage "Insane object id, ${__cdist_object_id}."

From a2992f0c6efb9f5f5d530bb721badfc828fd1da7 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Wed, 23 Feb 2011 09:22:38 +0100
Subject: [PATCH 4/5] be consistent and use __cdist_name_type_params as temp
 subdir

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist_tree_wrapper | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/cdist_tree_wrapper b/bin/cdist_tree_wrapper
index c33934e9..c5a179f3 100755
--- a/bin/cdist_tree_wrapper
+++ b/bin/cdist_tree_wrapper
@@ -51,7 +51,7 @@ mkdir -p "${__cdist_ddir}"
 echo "${__cdist_manifest}" > "${__cdist_ddir}/${__cdist_name_object_source}"
 
 # Record parameters to subdir
-tempparams="${__cdist_tmp_dir}/params"
+tempparams="${__cdist_tmp_dir}/${__cdist_name_type_params}"
 mkdir -p "$tempparams"
 
 while [ $# -gt 0 ]; do

From cea051a105436f6a984d571cc257a47a6ab03da2 Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Wed, 23 Feb 2011 09:23:59 +0100
Subject: [PATCH 5/5] fix __file/gencode: use destination, not path

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 conf/types/__file/gencode | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/conf/types/__file/gencode b/conf/types/__file/gencode
index 9d585533..1040875c 100755
--- a/conf/types/__file/gencode
+++ b/conf/types/__file/gencode
@@ -33,11 +33,11 @@ fi
 
 case "$type" in
    directory)
-      echo mkdir \"$path\"
+      echo mkdir \"$destination\"
    ;;
 
    file)
-      echo touch \"$path\"
+      echo touch \"$destination\"
    ;;
 
    *)
@@ -48,5 +48,5 @@ esac
 
 if [ -f mode ]; then
    mode="$(cat mode)"
-   echo chmod \"$mode\" \"$path\"
+   echo chmod \"$mode\" \"$destination\"
 fi