../bin/cdist-cache -> __cdist_cache
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
0fa95a5adc
commit
7050342d90
1 changed files with 11 additions and 16 deletions
|
@ -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
|
# Create base to move into
|
||||||
|
mkdir -p "${__cdist_local_base_cache_dir}"
|
||||||
|
|
||||||
__cdist_target_host="$1"; shift
|
__cdist_echo info \
|
||||||
|
"Saving cache to $(__cdist_host_cache_dir "$__cdist_target_host")"
|
||||||
# Create base to move into
|
rm -rf "$(__cdist_host_cache_dir "$__cdist_target_host")"
|
||||||
mkdir -p "${__cdist_local_base_cache_dir}"
|
mv "$__cdist_local_base_dir" \
|
||||||
|
"$(__cdist_host_cache_dir "$__cdist_target_host")"
|
||||||
# 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"
|
|
Loading…
Reference in a new issue