discuss todos / cleanup / make more fun for us

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-29 10:38:35 +02:00
commit 5306737d22
6 changed files with 45 additions and 29 deletions

View file

@ -68,7 +68,6 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_type:=type}
: ${__cdist_name_type_bin:=type_bin}
: ${__cdist_name_type_explorer:=type_explorer}
: ${__cdist_name_objects_created:=objects_created}
# Used for IDs: Allow everything not starting with - and .
: ${__cdist_sane_regexp:=[^-\.].*}
@ -109,7 +108,6 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_manifest_dir:=$__cdist_conf_dir/$__cdist_name_manifest}
: ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init}
: ${__cdist_type_dir:=$__cdist_conf_dir/$__cdist_name_type}
: ${__cdist_new_objects_created:=$__cdist_local_base_dir/$__cdist_name_objects_created}
################################################################################
# Local output

View file

@ -52,10 +52,9 @@ if [ -f "$__cdist_manifest" ]; then
export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")"
cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest"
# Tell cdist that there may be new objects
FIXME: Tell cdist that there may be new objects - WHO? Mama?
touch "$__cdist_new_objects_created"
else
__cdist_exit_err "${__cdist_manifest} needs to be executable."
fi
fi

View file

@ -46,6 +46,7 @@ if [ ! -f "$__cdist_object_finished" ]; then
# Check if type of object has >= 1 explorer
__cdist_has_explorer="$(__cdist_type_has_explorer "$__cdist_type")"
FIXME: put into cdist-object-explorer-run
# Run the type explorers for the current object if any
if [ "$__cdist_has_explorer" ]; then
if ! grep -q "$__cdist_type" "$__cdist_types_pushed"; then

View file

@ -30,6 +30,9 @@ __cdist_target_host="$1"; shift
__cdist_objects="$__cdist_tmp_dir/objects"
FIXME: reuse in subscripts, save in objects_base_dir
export __cdist_objects_created="$__cdist_tmp_dir/objects_created"
# Loop until we do not create new objects anymore
# which is equal to all objects have been run
touch "$__cdist_new_objects_created"
@ -48,11 +51,13 @@ while [ -f "$__cdist_new_objects_created" ]; do
while [ $# -gt 0 ]; do
__cdist_object="$1"; shift
FIXME: migrate into cdist-object-run
FIXME: take care of SSH foo after migration in while loop
__cdist_object_require="$(__cdist_object_require "$__cdist_object")"
if [ -f "$__cdist_object_require" ]; then
echo
while read __cdist_requirement; do
echo "Resolving dependency $__cdist_object -> $__cdist_requirement ..."
echo "Resolving dependency $__cdist_requirement for $__cdist_object ..."
cdist-object-run "$__cdist_target_host" "$__cdist_requirement"
done < "$__cdist_object_require"
fi