prefix all variables with __cdist_

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-03-26 22:09:19 +01:00
parent 4e2d063911
commit bdf3e4b86e
1 changed files with 17 additions and 17 deletions

View File

@ -32,49 +32,49 @@ set -eu
__cdist_target_host="$1"; shift __cdist_target_host="$1"; shift
object_listing="$__cdist_tmp_dir/objects" __cdist_objects="$__cdist_tmp_dir/objects"
types_pushed="$__cdist_tmp_dir/types_pushed" __cdist_types_pushed="$__cdist_tmp_dir/types_pushed"
touch "$types_pushed" touch "$__cdist_types_pushed"
# Get listing of objects # Get listing of objects
__cdist_object_list "$__cdist_out_object_dir" > "$object_listing" __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects"
# NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP # NEED TO CREATE ARRAY, SSH DESTROYS WHILE READ LOOP
while read object; do while read __cdist_object; do
set -- "$@" "$object" set -- "$@" "$__cdist_object"
done < "$object_listing" done < "$__cdist_objects"
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
object="$1"; shift __cdist_object="$1"; shift
__cdist_type="$(__cdist_type_from_object "$object")" __cdist_type="$(__cdist_type_from_object "$__cdist_object")"
# Check if type of object has >= 1 explorer # Check if type of object has >= 1 explorer
has_explorer="$(__cdist_type_has_explorer "$__cdist_type")" __cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")"
# If so, run explorers on remote side # If so, run explorers on remote side
if [ "$has_explorer" ]; then if [ "$__cdist_has_explorer" ]; then
# Transfer the type explorers # Transfer the type explorers
if ! grep -q "$__cdist_type" "$types_pushed"; then if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then
cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type" cdist-type-explorer-push "$__cdist_target_host" "$__cdist_type"
echo "$__cdist_type" >> "$types_pushed" echo "$__cdist_type" >> "$__cdist_types_pushed"
fi fi
# Run the type explorers for the current object # Run the type explorers for the current object
cdist-object-explorer-run "$__cdist_target_host" "$object" cdist-object-explorer-run "$__cdist_target_host" "$__cdist_object"
fi fi
# Run the gencode scripts for the current object # Run the gencode scripts for the current object
cdist-object-gencode-run "$__cdist_target_host" "$object" cdist-object-gencode-run "$__cdist_target_host" "$__cdist_object"
# Transfer the current object to the target # Transfer the current object to the target
cdist-object-push "$__cdist_target_host" "$object" cdist-object-push "$__cdist_target_host" "$__cdist_object"
# Run the code for the current object # Run the code for the current object
cdist-object-code-run "$__cdist_target_host" "$object" cdist-object-code-run "$__cdist_target_host" "$__cdist_object"
done done