begin cleanup doc for __directory

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/1.1
Nico Schottelius 14 years ago
parent 4c59a0fde1
commit 86d98ddec4
  1. 29
      conf/type/__directory/gencode
  2. 20
      conf/type/__directory/man.text

@ -20,28 +20,27 @@
#
# Handle directories
#
#
# __directory /etc [--mode --owner --group --parents [yes|no] ]
#
# If destination was specified, do not use the id
if [ -f "$__object/parameter/destination" ]; then
destination="$(cat "$__object/parameter/destination")"
else
# If no destination has been supplied, the id is the destination
# Prepend /, which got lost in the object id (and relative paths
# don't make sense)
destination="/$__object_id"
fi
destination="/$__object_id"
# Ensure we have an absolute path
if ! $(echo "$destination" | grep -q ^/); then
echo "Error: Destination ($destination) of $__object_id is not absolute." >&2
exit 1
# Include parent directories?
if [ -f "$__object/parameter/parents" ]; then
parents="$(cat "$__object/parameter/parents")"
if [ yes = "$parents" ]; then
mkdiropt="-p"
else
mkdiropt=""
fi
fi
# Only create if not already existent
if [ no = "$(cat "$__object/explorer/exists")" ]; then
echo mkdir \"$destination\"
echo mkdir $mkdiropt \"$destination\"
fi
# Mode settings
if [ -f "$__object/parameter/mode" ]; then
echo chmod \"$(cat "$__object/parameter/mode")\" \"$destination\"

@ -1,30 +1,25 @@
cdist-type__file(7)
===================
cdist-type__directory(7)
========================
Nico Schottelius <nico-cdist--@--schottelius.org>
NAME
----
cdist-type__file - Create files
cdist-type__directory - Create a directory
DESCRIPTION
-----------
This cdist type allows you to create files on the target.
This cdist type allows you to create directories on the target.
REQUIRED PARAMETERS
-------------------
type::
Specifies the type of file to be created. Either "directory" or "file"
None.
OPTIONAL PARAMETERS
-------------------
destination::
If supplied, use this as the destination on the target. Otherwise the
object_id is used.
group::
Group to chgrp to.
@ -34,9 +29,8 @@ mode::
owner::
User to chown to.
source::
If supplied, copy this file from the host running cdist to the target.
If not supplied, an empty file or directory will be created.
parents::
Whether to create parents as well (mkdir -p behaviour)
EXAMPLES

Loading…
Cancel
Save