../core/__cdist_code_run and ../core/__cdist_type_build_emulation

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-06-14 01:27:53 +02:00
parent 47c32d1b53
commit 9a86b392dc
4 changed files with 41 additions and 38 deletions

View file

@ -21,9 +21,10 @@
# This binary is executed on the remote side to execute code
#
. cdist-config
__cdist_code_run()
{
[ $# -eq 2 ] || __cdist_usage "<object> <type>"
set -ue
__cdist_object_self="$1"; shift
__cdist_code_type="$1"; shift
@ -48,3 +49,4 @@ if [ -e "$__cdist_code" ]; then
__cdist_exit_err "$__cdist_code exists, but is not a file."
fi
fi
}

View file

@ -46,7 +46,8 @@ __cdist_manifest_run()
#
# Ensure binaries exist and are up-to-date
cdist-type-build-emulation "${__cdist_out_type_bin_dir}" \
# FIXME: do only once! no need to check for every manifest!
__cdist_type_build_emulation "${__cdist_out_type_bin_dir}" \
|| __cdist_exit_err "Failed to build type emulation binaries"
# prepend our path, so all cdist tools come before other tools

View file

@ -29,7 +29,7 @@ __cdist_object_code_run()
# Code local
export __cdist_out_object_dir="$__cdist_out_object_dir"
cdist-code-run "$__cdist_object_code_run_object" "${__cdist_name_gencode_local}"
__cdist_code_run "$__cdist_object_code_run_object" "${__cdist_name_gencode_local}"
# Code remote
cdist-run-remote "$__cdist_target_host" \

View file

@ -20,12 +20,11 @@
# Build pseudo binaries for type emulation
#
. cdist-config
__cdist_type_build_emulation()
{
[ $# -eq 1 ] || __cdist_usage "<out dir>"
set -eu
__cdist_output_dir="$1"; shift
__cdist_type_emulator="$__cdist_abs_mydir/cdist-type-emulator"
if [ ! -d "${__cdist_type_dir}" ]; then
@ -41,3 +40,4 @@ mkdir -p "${__cdist_output_dir}"
while read type; do
ln -sf "${__cdist_type_emulator}" "${__cdist_output_dir}/${type}"
done < "${__cdist_tmp_file}"
}