Skip to content

Commit

Permalink
implement --state exists
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
  • Loading branch information
Steven Armstrong committed Apr 3, 2012
1 parent f3efa1e commit ffcf57e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions conf/type/__file/gencode-local
Expand Up @@ -23,6 +23,9 @@

destination="/$__object_id"
state_should="$(cat "$__object/parameter/state")"
exists="$(cat "$__object/explorer/exists")"

[ "$state_should" = "exists" -a "$exists" = "yes" ] && exit 0 # nothing to do

if [ "$state_should" = "present" ]; then
if [ -f "$__object/parameter/source" ]; then
Expand Down
6 changes: 5 additions & 1 deletion conf/type/__file/man.text
Expand Up @@ -21,7 +21,11 @@ None.
OPTIONAL PARAMETERS
-------------------
state::
'present' or 'absent', defaults to 'present'
'present', 'absent' or 'exists', defaults to 'present'
where:
present: the file is exactly the one from source
absent: the file does not exist
exists: the file from source but only if it doesn't already exist

group::
Group to chgrp to.
Expand Down

0 comments on commit ffcf57e

Please sign in to comment.