From 71b41df73324fa2f423b21c7d81b9baa4d6b131b Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Tue, 15 Oct 2013 14:55:35 +0200 Subject: [PATCH] no late delete Signed-off-by: Steven Armstrong --- cdist/conf/type/__link/gencode-remote | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cdist/conf/type/__link/gencode-remote b/cdist/conf/type/__link/gencode-remote index 2e41b7d9..cbdfd30f 100755 --- a/cdist/conf/type/__link/gencode-remote +++ b/cdist/conf/type/__link/gencode-remote @@ -49,10 +49,9 @@ file_type="$(cat "$__object/explorer/type")" case "$state_should" in present) if [ "$file_type" = "directory" ]; then - # our destination is currently a directory, move it out of the way + # our destination is currently a directory, delete it cat << DONE -destination_old="\$(mktemp "${destination}.cdist.XXXXXXXXXX")" -mv "$destination" "\$destination_old" +rm -rf "$destination" DONE fi @@ -60,13 +59,6 @@ DONE cat << DONE ln ${lnopt} -f "$source" "$destination" DONE - - if [ "$file_type" = "directory" ]; then - # delete the legacy directory - cat << DONE -rm -rf "\$destination_old" -DONE - fi ;; absent) # only delete if it is a sym/hard link