From 7525e82ce4524965f43b11a777627c1bcf40e0dc Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 02:52:42 +0100 Subject: [PATCH] clearify what to move Signed-off-by: Nico Schottelius --- bin/cdist-manifest-run-all | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/bin/cdist-manifest-run-all b/bin/cdist-manifest-run-all index 89ec0668..050e4850 100755 --- a/bin/cdist-manifest-run-all +++ b/bin/cdist-manifest-run-all @@ -89,16 +89,26 @@ while [ "$__cdist_new_objects_created" = "y" ]; do # where to save the newly created object __cdist_object_dir="$__cdist_out_object_dir/$__cdist_new_object" + mkdir -p "$__cdist_object_dir" - # Create top directory - __cdist_object_top_dir=${__cdist_object_dir%/*} - mkdir -p "$__cdist_object_top_dir" + # Move parts of the object (CANNOT MOVE COMPLETLEY, HIERACHY!) + __cdist_new_object_dir="$__cdist_new_objects_dir/$__cdist_new_object" - # Source of the new object - __cdist_new_object_dir="${__cdist_new_objects_dir}/$__cdist_new_object" + # Source + mv "${__cdist_new_object_dir}/${__cdist_name_object_source}" \ + "$__cdist_object_dir" - # Move object, not only parts - mv "${__cdist_new_object_dir}/" "$__cdist_object_top_dir" + # Parameter + if [ -d "${__cdist_new_object_dir}/${__cdist_name_parameter}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_name_parameter}" \ + "$__cdist_object_dir" + fi + + # Explorer + if [ -d "${__cdist_new_object_dir}/${__cdist_name_explorer}" ]; then + mv "${__cdist_new_object_dir}/${__cdist_name_explorer}" \ + "$__cdist_object_dir" + fi done < "$__cdist_new_objects_list" # Remove listing and objects, otherwise the next type will reuse it...