adopt first type: __file for messaging
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
		
					parent
					
						
							
								ac5fa7cd64
							
						
					
				
			
			
				commit
				
					
						edec2abb1d
					
				
			
		
					 3 changed files with 18 additions and 6 deletions
				
			
		|  | @ -41,7 +41,7 @@ if [ "$state_should" = "present" -o "$state_should" = "exists" ]; then | ||||||
| 
 | 
 | ||||||
|          if [ "$local_cksum" != "$remote_cksum" ]; then |          if [ "$local_cksum" != "$remote_cksum" ]; then | ||||||
|             echo "$__remote_copy" "$source" "${__target_host}:${destination}" |             echo "$__remote_copy" "$source" "${__target_host}:${destination}" | ||||||
|             echo "copy" >> "$__object/notifications" |             echo "copy" >> "$__messages_out" | ||||||
|          fi |          fi | ||||||
|       else |       else | ||||||
|          echo "Source \"$source\" does not exist." >&2 |          echo "Source \"$source\" does not exist." >&2 | ||||||
|  |  | ||||||
|  | @ -38,20 +38,23 @@ case "$state_should" in | ||||||
|       # Group |       # Group | ||||||
|       if [ -f "$__object/parameter/group" ]; then |       if [ -f "$__object/parameter/group" ]; then | ||||||
|          echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" |          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 |       fi | ||||||
| 
 | 
 | ||||||
|       # Owner |       # Owner | ||||||
|       if [ -f "$__object/parameter/owner" ]; then |       if [ -f "$__object/parameter/owner" ]; then | ||||||
|          echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" |          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 |       fi | ||||||
| 
 | 
 | ||||||
|       # Mode - needs to happen last as a chown/chgrp can alter mode by |       # Mode - needs to happen last as a chown/chgrp can alter mode by | ||||||
|       # clearing S_ISUID and S_ISGID bits (see chown(2)) |       # clearing S_ISUID and S_ISGID bits (see chown(2)) | ||||||
|       if [ -f "$__object/parameter/mode" ]; then |       if [ -f "$__object/parameter/mode" ]; then | ||||||
|          echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\" |          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 |       fi | ||||||
|    ;; |    ;; | ||||||
| 
 | 
 | ||||||
|  | @ -59,7 +62,7 @@ case "$state_should" in | ||||||
| 
 | 
 | ||||||
|       if [ "$exists" = "yes" ]; then |       if [ "$exists" = "yes" ]; then | ||||||
|          echo rm -f \"$destination\" |          echo rm -f \"$destination\" | ||||||
|          echo "removal" >> "$__object/notifications" |          echo "remove" >> "$__messages_out" | ||||||
|       fi |       fi | ||||||
| 
 | 
 | ||||||
|    ;; |    ;; | ||||||
|  |  | ||||||
|  | @ -41,6 +41,15 @@ source:: | ||||||
|    If not supplied, an empty file or directory will be created. |    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. |    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 | EXAMPLES | ||||||
| -------- | -------- | ||||||
|  | @ -81,5 +90,5 @@ SEE ALSO | ||||||
| 
 | 
 | ||||||
| COPYING | 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). | granted under the terms of the GNU General Public License version 3 (GPLv3). | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue