diff --git a/HACKERS_README b/HACKERS_README index d0dfe7a4..ccfca971 100644 --- a/HACKERS_README +++ b/HACKERS_README @@ -25,3 +25,7 @@ __cdist_config=$(pwd -P)/conf __cdist_target_host=localhost cdist-explorer-run # Display result find conf/cache/hosts/localhost + +# Soon working: +cdist-manifest-recursive-run /tmp ~/p/cdist/conf/cache/hosts/localhost/objects + diff --git a/bin/cdist-config b/bin/cdist-config index e3807243..5b08ddff 100755 --- a/bin/cdist-config +++ b/bin/cdist-config @@ -80,9 +80,12 @@ __cdist_bin_prefix="__" # Used for IDs __cdist_sane_regexp='[A-Za-z0-9]*[-A-Za-z0-9_]*' -# Used to mark file that created a specific type +# File that contains source of a specific object creation __cdist_object_source=".source" +# Mark object finished +__cdist_object_finished=".done" + ################################################################################ # Function list diff --git a/bin/cdist-manifest-recursive-run b/bin/cdist-manifest-recursive-run index 7ebd89d7..0a2a885b 100755 --- a/bin/cdist-manifest-recursive-run +++ b/bin/cdist-manifest-recursive-run @@ -43,21 +43,35 @@ __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" | \ + sed -e "s;$__cdist_object_source\$;;" \ + -e 's;^./;;' \ + > "$__cdist_tmp_file" - # find all objects (every object has the source recorded) - find . -name "$__cdist_object_source" > "$__cdist_tmp_file" + while read object; do + if [ ! -f "${object}/$__cdist_object_finished" ]; then + echo "Running object ${object} ..." + echo "Merging stuff back..." + touch "${object}/$__cdist_object_finished" + fi + done < "$__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 +# # 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 diff --git a/doc/man/cdist.text b/doc/man/cdist.text index 18f03489..109d2f01 100644 --- a/doc/man/cdist.text +++ b/doc/man/cdist.text @@ -27,7 +27,11 @@ a look at cdist-quickstart(7). REQUIREMENTS ------------ Cdist requires enabled ssh-server and a posix shell on the clients and -ssh-client and posix shell on the server. +ssh-client and posix shell on the server. Additionaly, it requires +the following unix tools: + +- find +- SEE ALSO