no late delete

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2013-10-15 14:55:35 +02:00
parent 6d5686229f
commit 71b41df733

View file

@ -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