load __cdist_dir from core

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-06-14 00:17:31 +02:00
parent 630fced69d
commit abe6e695bc
2 changed files with 39 additions and 22 deletions

View file

@ -111,6 +111,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache} : ${__cdist_local_base_cache_dir:=$__cdist_abs_mydir/../$__cdist_name_cache}
: ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"} : ${__cdist_conf_dir:="$(cd "$__cdist_abs_mydir/../conf" && pwd -P)"}
: ${__cdist_core_dir:="$(cd "$__cdist_abs_mydir/../core" && pwd -P)"}
: ${__cdist_explorer_dir:=$__cdist_conf_dir/$__cdist_name_explorer} : ${__cdist_explorer_dir:=$__cdist_conf_dir/$__cdist_name_explorer}
: ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest} : ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest}
@ -149,6 +150,15 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
################################################################################ ################################################################################
# Internal functions # Internal functions
# #
# *NEW* Load functions from library
for __cdist_lib in $__cdist_core_dir/*; do
echo Loading $__cdist_lib ...
. "$__cdist_lib"
done
exit 0
__cdist_echo() __cdist_echo()
{ {
__cdist_echo_type="$1"; shift __cdist_echo_type="$1"; shift
@ -208,6 +218,11 @@ __cdist_usage()
__cdist_exit_err "$__cdist_myname: $@" __cdist_exit_err "$__cdist_myname: $@"
} }
___cdist_lib_path()
{
echo $_
}
__cdist_init_deploy() __cdist_init_deploy()
{ {
__cdist_echo info "Creating clean directory structure " __cdist_echo info "Creating clean directory structure "

View file

@ -24,7 +24,8 @@
# #
. cdist-config __cdist_dir()
{
[ $# -eq 4 ] || __cdist_usage "<push|pull> <target host> <src dir> <dst dir>" [ $# -eq 4 ] || __cdist_usage "<push|pull> <target host> <src dir> <dst dir>"
set -ue set -ue
@ -49,3 +50,4 @@ elif [ "$__cdist_action" = "pull" ]; then
else else
__cdist_exit_err "Unknown action $__cdist_action" __cdist_exit_err "Unknown action $__cdist_action"
fi fi
}