implement the rename to cdist-type-build-emulation in cdist-manifest-run and cleanups

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-02-23 18:40:58 +01:00
parent 0bf48923a9
commit 0b94a11d27
4 changed files with 12 additions and 9 deletions

View file

@ -37,6 +37,7 @@ set -au
: ${__cdist_name_init:=init} : ${__cdist_name_init:=init}
: ${__cdist_name_out_dir:=out} : ${__cdist_name_out_dir:=out}
: ${__cdist_name_conf_dir:=conf} : ${__cdist_name_conf_dir:=conf}
: ${__cdist_name_type_bin:=type_bin}
# Name of the manifest file in types # Name of the manifest file in types
: ${__cdist_name_manifest:=manifest} : ${__cdist_name_manifest:=manifest}
@ -92,6 +93,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_out_dir:=$__cdist_tmp_dir/$__cdist_name_out_dir} : ${__cdist_out_dir:=$__cdist_tmp_dir/$__cdist_name_out_dir}
: ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer} : ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer}
: ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object} : ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object}
: ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin}
################################################################################ ################################################################################

View file

@ -37,9 +37,11 @@ cdist-bin-transfer "$__cdist_target_host" "${__cdist_remote_bin_dir}"
# Execute explorer # Execute explorer
cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir" cdist-explorer-run-init "$__cdist_target_host" "$__cdist_out_explorer_dir"
# Create initial object base
cdist-manifest-init "$__cdist_target_host" "$__cdist_out_object_dir"
exit 2 exit 2
cdist-manifest-init "$__cdist_target_host" "$__cdist_out_object_dir"
cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir" cdist-manifest-run-all "$__cdist_target_host" "$__cdist_out_object_dir"
cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir" cdist-object-explorer-all "$__cdist_target_host" "$__cdist_out_object_dir"
exit 0 exit 0

View file

@ -31,10 +31,10 @@ export __cdist_manifest="$1"; shift
export __cdist_output_dir="$1"; shift export __cdist_output_dir="$1"; shift
# Ensure binaries exist and are up-to-date # Ensure binaries exist and are up-to-date
cdist-build-bin || __cdist_exit_err "Failed to build support binaries" cdist-type-build-emulation || __cdist_exit_err "Failed to build type emulation binaries"
# prepend our path, so all cdist tools come before other tools # prepend our path, so all cdist tools come before other tools
PATH="${__cdist_cache_bin}:$PATH" PATH="${__cdist_out_type_bin_dir}:$PATH"
# Force -x, so the user is aware the file is executed # Force -x, so the user is aware the file is executed
if [ ! -x "${__cdist_manifest}" ]; then if [ ! -x "${__cdist_manifest}" ]; then

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# 2010 Nico Schottelius (nico-cdist at schottelius.org) # 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -17,15 +17,14 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with cdist. If not, see <http://www.gnu.org/licenses/>. # along with cdist. If not, see <http://www.gnu.org/licenses/>.
# #
# Build pseudo binaries # Build pseudo binaries for type emulation
# #
. cdist-config . cdist-config
set -aeu set -aeu
# FIXME: load this from the cdist-core library # FIXME: load this from the cdist-core library
__cdist_tree_wrapper="$(which cdist_tree_wrapper)" __cdist_type_emulator="$(which cdist-type-emulator)"
if [ ! -d ${__cdist_type_dir} ]; then if [ ! -d ${__cdist_type_dir} ]; then
__cdist_exit_err "$__cdist_type_dir must exist and contain available types" __cdist_exit_err "$__cdist_type_dir must exist and contain available types"
@ -36,7 +35,7 @@ cd "${__cdist_type_dir}"
ls -1 > "${__cdist_tmp_file}" ls -1 > "${__cdist_tmp_file}"
# Create binaries # Create binaries
mkdir -p "${__cdist_cache_bin}" mkdir -p "${__cdist_out_type_bin_dir}"
while read type; do while read type; do
ln -sf "${__cdist_tree_wrapper}" "${__cdist_cache_bin}/${type}" ln -sf "${__cdist_type_emulator}" "${__cdist_out_type_bin_dir}/${type}"
done < "${__cdist_tmp_file}" done < "${__cdist_tmp_file}"