add more functions to cdist-config

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2010-09-29 18:55:18 +02:00
parent c0c01187be
commit 9116df2edd

View file

@ -27,11 +27,26 @@
: ${CDIST_HOSTS:=$CDIST_CONFIG/hosts} : ${CDIST_HOSTS:=$CDIST_CONFIG/hosts}
: ${CDIST_MODULES:=$CDIST_CONFIG/modules} : ${CDIST_MODULES:=$CDIST_CONFIG/modules}
cdist_debug_echo() ################################################################################
# cconf standard vars prefixed with cdist
__cdist_pwd="$(pwd -P)"
__cdist_mydir="${0%/*}";
__cdist_abs_mydir="$(cd "$__mydir" && pwd -P)"
__cdist_myname=${0##*/};
__cdist_abs_myname="$__abs_mydir/$__myname"
__cdist_debug_echo()
{ {
[ "$CDIST_DEBUG" ] && echo "Debug: $@" [ "$CDIST_DEBUG" ] && echo "Debug: $@"
} }
__cdist_usage()
{
echo "$__cdist_myname: $@"
exit 1
}
: ${CDIST_TMP:=$(mktemp /tmp/cdist.XXXXXXXXXXXX)} : ${CDIST_TMP:=$(mktemp /tmp/cdist.XXXXXXXXXXXX)}
#set -e #set -e
@ -39,7 +54,7 @@ cdist_debug_echo()
# load libraries so every program has them available # load libraries so every program has them available
find "${CDIST_LIBDIR}" -type f > "${CDIST_TMP}" find "${CDIST_LIBDIR}" -type f > "${CDIST_TMP}"
while read __cdist_lib; do while read __cdist_lib; do
cdist_debug_echo "Loading $__cdist_lib ..." __cdist_debug_echo "Loading $__cdist_lib ..."
. "${__cdist_lib}" . "${__cdist_lib}"
done < "${CDIST_TMP}" done < "${CDIST_TMP}"