../bin/cdist-cache -> __cdist_cache

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-06-17 10:30:23 +02:00
parent 0fa95a5adc
commit 7050342d90

View file

@ -18,22 +18,17 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>. # along with cdist. If not, see <http://www.gnu.org/licenses/>.
# #
# #
# Let's build a cconfig tree from a configuration # Save the configuration tree into the local cache
# And save it into the cache tree
# #
. cdist-config __cdist_cache()
[ $# -eq 1 ] || __cdist_usage "<target host>" {
set -u
__cdist_target_host="$1"; shift
# Create base to move into # Create base to move into
mkdir -p "${__cdist_local_base_cache_dir}" mkdir -p "${__cdist_local_base_cache_dir}"
# Now determine absolute path __cdist_echo info \
__cdist_ddir="$(__cdist_host_cache_dir "$__cdist_target_host")" "Saving cache to $(__cdist_host_cache_dir "$__cdist_target_host")"
rm -rf "$(__cdist_host_cache_dir "$__cdist_target_host")"
__cdist_echo info "Saving cache to $__cdist_ddir " mv "$__cdist_local_base_dir" \
rm -rf "$__cdist_ddir" "$(__cdist_host_cache_dir "$__cdist_target_host")"
mv "$__cdist_local_base_dir" "$__cdist_ddir" }