From 65e84f4b4b60d83c802935bc0fca2551d286434a Mon Sep 17 00:00:00 2001
From: Nico Schottelius <nico@kr.ethz.ch>
Date: Fri, 25 Feb 2011 01:25:58 +0100
Subject: [PATCH] use cdist-dir to push results to target

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
---
 bin/cdist-deploy-to     |  6 +++++-
 bin/cdist-exec-transfer | 38 --------------------------------------
 2 files changed, 5 insertions(+), 39 deletions(-)
 delete mode 100755 bin/cdist-exec-transfer

diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to
index a8d77334..71f6ef0c 100755
--- a/bin/cdist-deploy-to
+++ b/bin/cdist-deploy-to
@@ -58,7 +58,11 @@ cdist-object-explorer-all     "$__cdist_target_host" "$__cdist_out_object_dir"
 # Generate code for all objects
 cdist-object-codegen-all      "$__cdist_target_host" "$__cdist_out_object_dir"
 
+# Transfer all objects including code
+cdist-dir push "$__cdist_target_host" "$__cdist_out_object_dir" \
+   "${__cdist_remote_out_object_base_dir}"
+
 exit 2
 
-cdist-exec-transfer           "$__cdist_target_host" "$__cdist_out_execs"
+
 cdist-exec-run                "$__cdist_target_host"
diff --git a/bin/cdist-exec-transfer b/bin/cdist-exec-transfer
deleted file mode 100755
index d1ba128d..00000000
--- a/bin/cdist-exec-transfer
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-#
-# 2010-2011 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/>.
-#
-#
-# Transfer executables
-#
-
-. cdist-config
-
-[ $# -eq 2 ] || __cdist_usage "<target host> <exec_dir>"
-set -e
-
-export __cdist_target_host="$1"; shift
-export __cdist_exec_dir="$1"; shift
-
-
-# re-create basedir so it's clean
-ssh "root@${__cdist_target_host}" "rm -rf \"${__cdist_remote_cache_exec}\" && mkdir -p \"${__cdist_remote_cache_exec}\""
-
-# FIXME: enable -q as soon as the code is cleaned up
-scp -r "${__cdist_exec_dir}"/* \
-       "root@${__cdist_target_host}:${__cdist_remote_cache_exec}"