Merge remote branch 'nico/master'

This commit is contained in:
Steven Armstrong 2011-02-22 11:55:04 +01:00
commit cb302053cb
2 changed files with 13 additions and 3 deletions

View file

@ -23,7 +23,7 @@
# #
. cdist-config . cdist-config
[ $# -eq 3 ] || __cdist_usage "<target host> <manifest> <outdir>" [ $# -ge 3 ] || __cdist_usage "<target host> <manifest> <outdir> [manifest arguments]"
set -u set -u
export __cdist_target_host="$1"; shift export __cdist_target_host="$1"; shift
@ -43,4 +43,4 @@ fi
mkdir -p "${__cdist_output_dir}" || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}" mkdir -p "${__cdist_output_dir}" || __cdist_exit_err "Cannot create output dir ${__cdist_output_dir}"
__cdist_exec_fail_on_error "${__cdist_manifest}" __cdist_exec_fail_on_error "${__cdist_manifest}" "$@"

View file

@ -50,7 +50,10 @@ while [ "$__cdist_new_objects_created" = "y" ]; do
# Check every object, if we need to run it # Check every object, if we need to run it
while read __cdist_object; do while read __cdist_object; do
# Full path to current object
__cdist_cur_object_dir="$__cdist_object_base_dir/$__cdist_object" __cdist_cur_object_dir="$__cdist_object_base_dir/$__cdist_object"
# Only the id
__cdist_object_id="${__cdist_object#*/}"
if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then
echo "Working on object ${__cdist_object} ..." echo "Working on object ${__cdist_object} ..."
@ -61,7 +64,14 @@ while [ "$__cdist_new_objects_created" = "y" ]; do
if [ -x "${__cdist_manifest}" ]; then if [ -x "${__cdist_manifest}" ]; then
echo "Executing manifest ${__cdist_manifest} ..." echo "Executing manifest ${__cdist_manifest} ..."
cdist-manifest-run "$__cdist_target_host" "${__cdist_manifest}" "${__cdist_new_objects_dir}"
# Safely change directory, convienent for type-writers
(
cd "$__cdist_cur_object_dir"
cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest" \
"$__cdist_new_objects_dir" "$__cdist_object_id"
)
__cdist_object_list "${__cdist_new_objects_dir}" > "$__cdist_new_objects_list" __cdist_object_list "${__cdist_new_objects_dir}" > "$__cdist_new_objects_list"
# Verify no conflicting objects have been created # Verify no conflicting objects have been created