diff --git a/bin/cdist-code-run b/bin/cdist-code-run
index a6a9137f..e969d942 100755
--- a/bin/cdist-code-run
+++ b/bin/cdist-code-run
@@ -32,31 +32,16 @@ if [ ! -d "$(__cdist_object_dir "$object")" ]; then
__cdist_exit_err "Object $object is missing."
fi
-finished="$(__cdist_object_code_finished "$object")"
-require="$(__cdist_object_require "$object")"
-
code="$(__cdist_object_code "$object")-${__cdist_gencode_type}"
-# Do nothing if our work has been done
-if [ -f "$finished" ]; then
- exit 0
-fi
-
echo "Checking code-${__cdist_gencode_type} for $object ..."
-if [ -f "$require" ]; then
- while read requirement; do
- echo "Requiring dependency $requirement for $object ..."
- cdist-code-run "$requirement" "$__cdist_gencode_type"
- done < "$require"
-fi
if [ -e "$code" ]; then
if [ -f "$code" ]; then
if [ -x "$code" ]; then
echo "Executing code-${__cdist_gencode_type} for $object ..."
"$code"
- touch "$finished"
else
__cdist_exit_err "$code exists, but is not executable."
fi
diff --git a/bin/cdist-config b/bin/cdist-config
index f289379b..531f709c 100755
--- a/bin/cdist-config
+++ b/bin/cdist-config
@@ -43,7 +43,6 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_bin:=bin}
: ${__cdist_name_cache:=cache}
: ${__cdist_name_code:=code}
-: ${__cdist_name_code_finished:=codedone}
: ${__cdist_name_conf_dir:=conf}
: ${__cdist_name_dot_cdist:=.cdist}
: ${__cdist_name_explorer:=explorer}
@@ -58,17 +57,20 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_object_finished:=done}
: ${__cdist_name_object_id:=object_id}
: ${__cdist_name_object_source:=source}
+: ${__cdist_name_objects_created:=.objects_created}
: ${__cdist_name_out_dir:=out}
: ${__cdist_name_parameter:=parameter}
: ${__cdist_name_parameter_required:=required}
: ${__cdist_name_parameter_optional:=optional}
: ${__cdist_name_require:=require}
+: ${__cdist_name_self:=self}
: ${__cdist_name_singleton:=singleton}
: ${__cdist_name_target_host:=target_host}
: ${__cdist_name_target_user:=target_user}
: ${__cdist_name_type:=type}
: ${__cdist_name_type_bin:=type_bin}
: ${__cdist_name_type_explorer:=type_explorer}
+: ${__cdist_name_type_explorer_pushed:=.explorer_pushed}
# Used for IDs: Allow everything not starting with - and .
: ${__cdist_sane_regexp:=[^-\.].*}
@@ -88,6 +90,7 @@ __cdist_abs_myname="$__cdist_abs_mydir/$__cdist_myname"
: ${__cdist_name_var_target_user:=__$__cdist_name_target_user}
: ${__cdist_name_var_object:=__$__cdist_name_object}
: ${__cdist_name_var_object_id:=__$__cdist_name_object_id}
+: ${__cdist_name_var_self:=__$__cdist_name_self}
: ${__cdist_name_var_type:=__$__cdist_name_type}
@@ -116,8 +119,11 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_out_dir:=$__cdist_local_base_dir/$__cdist_name_out_dir}
: ${__cdist_out_explorer_dir:=$__cdist_out_dir/$__cdist_name_explorer}
: ${__cdist_out_object_dir:=$__cdist_out_dir/$__cdist_name_object}
+: ${__cdist_out_type_dir:=$__cdist_out_dir/$__cdist_name_type}
: ${__cdist_out_type_bin_dir:=$__cdist_out_dir/$__cdist_name_type_bin}
+: ${__cdist_objects_created:=$__cdist_out_object_dir/$__cdist_name_objects_created}
+
################################################################################
# Remote base
#
@@ -135,6 +141,7 @@ __cdist_tmp_file=$(mktemp "$__cdist_tmp_dir/cdist.XXXXXXXXXXXX")
: ${__cdist_remote_out_explorer_dir:=$__cdist_remote_out_dir/$__cdist_name_explorer}
: ${__cdist_remote_out_object_dir:=$__cdist_remote_out_dir/$__cdist_name_object}
+
################################################################################
# Internal functions
#
@@ -178,6 +185,16 @@ __cdist_init_deploy()
ln -sf "$__cdist_conf_dir" "$__cdist_local_base_dir/$__cdist_name_conf_dir"
}
+__cdist_new_objects_created()
+{
+ touch "$__cdist_tmp_dir/object_created"
+}
+
+__cdist_has_new_objects()
+{
+ touch "$__cdist_tmp_dir/object_created"
+}
+
################################################################################
# Object
#
@@ -187,9 +204,9 @@ __cdist_object_code()
echo "$(__cdist_object_dir "$1")/${__cdist_name_code}"
}
-__cdist_object_code_finished()
+__cdist_object_finished()
{
- echo "$(__cdist_object_dir "$1")/${__cdist_name_code_finished}"
+ echo "$(__cdist_object_dir "$1")/${__cdist_name_object_finished}"
}
__cdist_object_dir()
@@ -321,6 +338,18 @@ __cdist_type_has_explorer()
fi
}
+__cdist_type_explorer_pushed()
+{
+ [ -f "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}" ] \
+ && grep -q "$1" "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}"
+}
+
+__cdist_type_explorer_pushed_add()
+{
+ [ -d "$__cdist_out_type_dir" ] || mkdir "$__cdist_out_type_dir"
+ echo "$1" >> "${__cdist_out_type_dir}/${__cdist_name_type_explorer_pushed}"
+}
+
__cdist_type_gencode()
{
echo "${__cdist_type_dir}/$1/${__cdist_name_gencode}"
diff --git a/bin/cdist-deploy-to b/bin/cdist-deploy-to
index 6cf694d9..e44ceff4 100755
--- a/bin/cdist-deploy-to
+++ b/bin/cdist-deploy-to
@@ -49,7 +49,6 @@ cdist-dir push "$__cdist_target_host" "${__cdist_abs_mydir}" "${__cdist_remote_b
cdist-explorer-run-global "$__cdist_target_host"
cdist-manifest-run-init "$__cdist_target_host"
-cdist-manifest-run-all "$__cdist_target_host"
cdist-object-run-all "$__cdist_target_host"
cdist-cache "$__cdist_target_host"
diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all
deleted file mode 100755
index a431576d..00000000
--- a/bin/cdist-manifest-run-all
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-#
-# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
-#
-# This file is part of cdist.
-#
-# cdist is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# cdist is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with cdist. If not, see .
-#
-# Run all manifests
-#
-
-. cdist-config
-[ $# -eq 1 ] || __cdist_usage ""
-set -eu
-
-__cdist_target_host="$1"; shift
-
-__cdist_objects_list="${__cdist_tmp_dir}/objects_file"
-__cdist_new_objects_list="${__cdist_tmp_dir}/new_objects_file"
-
-# Loop until we do not create new objects anymore
-# which is equal to all objects have been run
-__cdist_new_objects_created=y
-while [ "$__cdist_new_objects_created" = "y" ]; do
- # Assume we're done after this run
- __cdist_new_objects_created=n
-
- __cdist_object_list "$__cdist_out_object_dir" > "$__cdist_objects_list"
-
- # Check every object, if we need to run it
- while read __cdist_object_self; do
- # Full path to current object
- __cdist_cur_object_dir="$(__cdist_object_dir "$__cdist_object_self")"
-
- # Only the id
- __cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")"
-
- if [ ! -f "${__cdist_cur_object_dir}/$__cdist_name_object_finished" ]; then
- echo "Checking manifest for ${__cdist_object_self} ..."
-
- __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")"
- __cdist_manifest="$(__cdist_type_manifest "${__cdist_type}")"
-
- if [ -f "$__cdist_manifest" ]; then
- if [ -x "$__cdist_manifest" ]; then
- # Make __cdist_manifest available for cdist-type-emulator
- export __cdist_manifest
-
- echo "Executing manifest ${__cdist_manifest} ..."
- # Make variables available to non-core - FIXME: beatify
- export $__cdist_name_var_object="$__cdist_cur_object_dir"
- export $__cdist_name_var_object_id="$__cdist_object_id"
- export $__cdist_name_var_type="$(__cdist_type_dir "$__cdist_type")"
-
- cdist-manifest-run "$__cdist_target_host" "$__cdist_manifest"
- __cdist_new_objects_created=y
- else
- __cdist_exit_err "${__cdist_manifest} needs to be executable."
- fi
- fi
- fi
-
- # done with this object
- touch "$__cdist_cur_object_dir/$__cdist_name_object_finished"
- done < "$__cdist_objects_list"
-done
diff --git a/bin/cdist-object-code-run b/bin/cdist-object-code-run
index b75f6f46..d0722788 100755
--- a/bin/cdist-object-code-run
+++ b/bin/cdist-object-code-run
@@ -39,4 +39,3 @@ cdist-run-remote "$__cdist_target_host" \
"export __cdist_out_object_dir=\"$__cdist_remote_out_object_dir\";" \
"cdist-code-run" "$__cdist_object" "${__cdist_name_gencode_remote}" \
|| __cdist_exit_err "Remote code failed for $__cdist_object"
-
diff --git a/bin/cdist-object-explorer-run b/bin/cdist-object-explorer-run
index e349a490..ff0668e5 100755
--- a/bin/cdist-object-explorer-run
+++ b/bin/cdist-object-explorer-run
@@ -24,38 +24,45 @@
. cdist-config
[ $# -eq 2 ] || __cdist_usage "