cleanups + new __cdist_exit_err

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-02 14:55:28 +01:00
parent 97a14fe933
commit f7f687995b
5 changed files with 23 additions and 7 deletions

View file

@ -38,4 +38,4 @@ ls -1 > "${__cdist_tmp_file}"
mkdir -p "${__cdist_cache_bin}"
while read type; do
ln -s "${__cdist_tree_wrapper}" "${__cdist_cache_bin}/${__cdist_bin_prefix}${type}"
done
done < "${__cdist_tmp_file}"

View file

@ -22,13 +22,13 @@
# And save it into the cache tree
#
#[ $# -eq 1 ] || __cdist_usage "cconf"
. cdist-config
[ "${__cdist_target_host}" ] || __cdist_usage "Need \$__cdist_target_host setup"
set -au
cdist_tree_wrapper="$(which cdist_tree_wrapper)"
__cdist_tree_wrapper="$(which cdist_tree_wrapper)"
# used to build the tree and other stuff
__cdist_bindir="${__cdist_tmp_dir}/bin"

View file

@ -29,6 +29,7 @@
: ${__cdist_cache_dir:=$__cdist_config/cache}
: ${__cdist_cache_hosts:=$__cdist_cache_dir/hosts}
: ${__cdist_cache_bin:=$__cdist_cache_dir/bin}
# obsolete?: lib not needed, hosts replaced by manifests, modules by types
@ -50,6 +51,13 @@ __cdist_abs_mydir="$(cd "$__cdist_mydir" && pwd -P)"
__cdist_myname=${0##*/};
__cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
################################################################################
# Other constants
# Used for generating binaries in cdist-build-bin
__cdist_bin_prefix="__"
################################################################################
# Function list
#
@ -60,10 +68,15 @@ __cdist_debug_echo()
fi
}
__cdist_exit_err()
{
echo "$@"
exit 1
}
__cdist_usage()
{
echo "$__cdist_myname: $@"
exit 1
__cdist_exit_err "$__cdist_myname: $@"
}

View file

@ -28,7 +28,7 @@
set -e
# Internal variables, usable by
export __cdist_intern_target_host="$1"
export __cdist_target_host="$1"
export __cdist_intern_deploy_host="$(cdist_explore_hostname)"
. cdist-build "$__cdist_intern_target_host"

View file

@ -32,3 +32,6 @@ cdist-build-explorer | ssh "$1" > "${CDIST_TMP}"
# And a filter function like grep '^__cdist_explore.*=".*"$'
# is probably not effective!
. "${CDIST_TMP}"