forked from ungleich-public/cdist
../core/__cdist_code_run and ../core/__cdist_type_build_emulation
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
parent
47c32d1b53
commit
9a86b392dc
4 changed files with 41 additions and 38 deletions
|
@ -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
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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" \
|
||||
|
|
|
@ -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}"
|
||||
}
|
Loading…
Reference in a new issue