adopt first type: __file for messaging

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-11-26 01:01:44 +01:00
parent ac5fa7cd64
commit edec2abb1d
3 changed files with 18 additions and 6 deletions

View File

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

View File

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

View File

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