From 2ef17f9bf20ae743908fb90d361bddb4dc00c8ef Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 23 Mar 2011 12:15:00 +0100 Subject: [PATCH] begin merge section in cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 10e0534d..0b709a13 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -149,14 +149,18 @@ exit 1 ################################################################################ # Merge object # +# Save original destination +__cdist_out_object_dir="$__cdist_out_object_dir_orig" + +__cdist_object_destination_dir="$(__cdist_object_dir "$__cdist_object_self")" # -# Ensure that only optional or required parameters are given +# If the object already exists and is exactly the same, merge it. Otherwise fail. # +if [ -e "${__cdist_new_object_dir}" ]; then + source="$(__cdist_object_source "${__cdist_new_object_dir}")" + __cdist_exit_err "${__cdist_object} already exists (source: $source)" -# old stuff -# if [ -e "${__cdist_new_object_dir}" ]; then -# source="$(__cdist_object_source "${__cdist_new_object_dir}")" -# __cdist_exit_err "${__cdist_object} already exists (source: $source)" -# fi + +fi