From 7050342d90eca2e46a3f9ee52310df017e7d3ecb Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 17 Jun 2011 10:30:23 +0200 Subject: [PATCH] ../bin/cdist-cache -> __cdist_cache Signed-off-by: Nico Schottelius --- bin/cdist-cache => core/__cdist_cache | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) rename bin/cdist-cache => core/__cdist_cache (60%) diff --git a/bin/cdist-cache b/core/__cdist_cache similarity index 60% rename from bin/cdist-cache rename to core/__cdist_cache index ee27ffb4..44c60125 100755 --- a/bin/cdist-cache +++ b/core/__cdist_cache @@ -18,22 +18,17 @@ # along with cdist. If not, see . # # -# Let's build a cconfig tree from a configuration -# And save it into the cache tree +# Save the configuration tree into the local cache # -. cdist-config -[ $# -eq 1 ] || __cdist_usage "" -set -u +__cdist_cache() +{ + # Create base to move into + mkdir -p "${__cdist_local_base_cache_dir}" -__cdist_target_host="$1"; shift - -# Create base to move into -mkdir -p "${__cdist_local_base_cache_dir}" - -# Now determine absolute path -__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" - -__cdist_echo info "Saving cache to $__cdist_ddir " -rm -rf "$__cdist_ddir" -mv "$__cdist_local_base_dir" "$__cdist_ddir" + __cdist_echo info \ + "Saving cache to $(__cdist_host_cache_dir "$__cdist_target_host")" + rm -rf "$(__cdist_host_cache_dir "$__cdist_target_host")" + mv "$__cdist_local_base_dir" \ + "$(__cdist_host_cache_dir "$__cdist_target_host")" +}