diff --git a/cdist/conf/type/__file/gencode-local b/cdist/conf/type/__file/gencode-local index 99456c5b..8cd9b24e 100755 --- a/cdist/conf/type/__file/gencode-local +++ b/cdist/conf/type/__file/gencode-local @@ -41,7 +41,7 @@ if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then if [ "$local_cksum" != "$remote_cksum" ]; then echo "$__remote_copy" "$source" "${__target_host}:${destination}" - echo "copy" >> "$__object/notifications" + echo "copy" >> "$__messages_out" fi else echo "Source \"$source\" does not exist." >&2 diff --git a/cdist/conf/type/__file/gencode-remote b/cdist/conf/type/__file/gencode-remote index fa2adc6f..6e1fa5be 100755 --- a/cdist/conf/type/__file/gencode-remote +++ b/cdist/conf/type/__file/gencode-remote @@ -38,20 +38,23 @@ case "$state_should" in # Group if [ -f "$__object/parameter/group" ]; then echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" - echo "chgrp" >> "$__object/notifications" +# FIXME: only if necessary, not if parameter is present +# echo "chgrp" >> "$__object/notifications" fi # Owner if [ -f "$__object/parameter/owner" ]; then echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" - echo "chown" >> "$__object/notifications" +# FIXME: only if necessary, not if parameter is present +# echo "chown" >> "$__object/notifications" fi # Mode - needs to happen last as a chown/chgrp can alter mode by # clearing S_ISUID and S_ISGID bits (see chown(2)) if [ -f "$__object/parameter/mode" ]; then echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" - echo "chmod" >> "$__object/notifications" +# FIXME: only if necessary, not if parameter is present +# echo "chmod" >> "$__object/notifications" fi ;; @@ -59,7 +62,7 @@ case "$state_should" in if [ "$exists" = "yes" ]; then echo rm -f \"$destination\" - echo "removal" >> "$__object/notifications" + echo "remove" >> "$__messages_out" fi ;; diff --git a/cdist/conf/type/__file/man.text b/cdist/conf/type/__file/man.text index 1c61fd51..9ac82d0f 100644 --- a/cdist/conf/type/__file/man.text +++ b/cdist/conf/type/__file/man.text @@ -41,6 +41,15 @@ source:: If not supplied, an empty file or directory will be created. If source is '-' (dash), take what was written to stdin as the file content. +MESSAGES +-------- + +copy:: + File was copied because cksum was different from local version + +remove:: + File exists, but state is absent, file will be removed by generated code. + EXAMPLES -------- @@ -81,5 +90,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is +Copyright \(C) 2011-2013 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3).