From 5237bcd5cd8d94eca79c9ee6822e81ecdc77ae34 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 5 Feb 2011 19:49:08 +0100 Subject: [PATCH] first generic version working for objects Signed-off-by: Nico Schottelius --- bin/cdist-manifest-recursive-run | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/bin/cdist-manifest-recursive-run b/bin/cdist-manifest-recursive-run index da9187fd..7ebd89d7 100755 --- a/bin/cdist-manifest-recursive-run +++ b/bin/cdist-manifest-recursive-run @@ -24,24 +24,44 @@ # mark the object as being run # and iterate until all objects are marked being run. # +# +# . cdist-config if [ $# -ne 2 ]; then - __cdist_usage " " + __cdist_usage " " fi set -eu __cdist_output_dir="$1"; shift -__cdist_manifest="$1"; shift +__cdist_object_dir="$1"; shift __cdist_object_ran_all=0 while [ "$__cdist_object_ran_all" = 0 ]; do + cd "$__cdist_object_dir" + # FIXME past 1.0: allow multi level ids (/example/id instead of example_id only) + # OUTER LOOP NEEDED IF GOING OVER ALL OBJECTS WITH FIND? + for type in *; do + cd "$__cdist_object_dir/$type" + + # find all objects (every object has the source recorded) + find . -name "$__cdist_object_source" > "$__cdist_tmp_file" + + while read object; do + echo "Running object ${type}/${object} ..." + done < "$__cdist_tmp_file" + done + + # FIXME: abort on real case only :-) + __cdist_object_ran_all=1 done +exit 0 + # Ensure binaries exist and are up-to-date cdist-build-bin