From 9116df2eddaac5b2349280952e0985f2da8683aa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 29 Sep 2010 18:55:18 +0200 Subject: [PATCH] add more functions to cdist-config Signed-off-by: Nico Schottelius --- bin/cdist-config | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bin/cdist-config b/bin/cdist-config index c72cf1e5..94c836c1 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -27,11 +27,26 @@ : ${CDIST_HOSTS:=$CDIST_CONFIG/hosts} : ${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_usage() +{ + echo "$__cdist_myname: $@" + exit 1 +} + : ${CDIST_TMP:=$(mktemp /tmp/cdist.XXXXXXXXXXXX)} #set -e @@ -39,7 +54,7 @@ cdist_debug_echo() # load libraries so every program has them available find "${CDIST_LIBDIR}" -type f > "${CDIST_TMP}" while read __cdist_lib; do - cdist_debug_echo "Loading $__cdist_lib ..." + __cdist_debug_echo "Loading $__cdist_lib ..." . "${__cdist_lib}" done < "${CDIST_TMP}"