add --recursive to __directory (man, gencode, parameter, changelog)

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-22 09:59:41 +01:00
parent e921986e32
commit e4190c3d0a
4 changed files with 20 additions and 2 deletions

View file

@ -36,6 +36,12 @@ if [ -f "$__object/parameter/parents" ]; then
fi fi
fi fi
if [ -f "$__object/parameter/recursive" ]; then
if [ yes = "$(cat "$__object/parameter/recursive")" ]; then
recursive="-R"
fi
fi
# Only create if not already existent # Only create if not already existent
if [ no = "$(cat "$__object/explorer/exists")" ]; then if [ no = "$(cat "$__object/explorer/exists")" ]; then
echo mkdir $mkdiropt \"$destination\" echo mkdir $mkdiropt \"$destination\"
@ -48,10 +54,10 @@ fi
# Group # Group
if [ -f "$__object/parameter/group" ]; then if [ -f "$__object/parameter/group" ]; then
echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" echo chgrp $recursive \"$(cat "$__object/parameter/group")\" \"$destination\"
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 $recursive \"$(cat "$__object/parameter/owner")\" \"$destination\"
fi fi

View file

@ -32,6 +32,11 @@ owner::
parents:: parents::
Whether to create parents as well (mkdir -p behaviour). Must be yes or no. Whether to create parents as well (mkdir -p behaviour). Must be yes or no.
recursive::
If supplied the chgrp and chown call will run recursively.
This does *not* influence the behaviour of chmod.
Must be yes or no.
EXAMPLES EXAMPLES
-------- --------
@ -45,6 +50,9 @@ __directory /etc --owner root --group root --mode 0755
# Create nfs service directory, including parents # Create nfs service directory, including parents
__directory /home/services/nfs --parents yes __directory /home/services/nfs --parents yes
# Change permissions recursively
__directory /home/services --recursive yes --owner root --group root
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View file

@ -2,3 +2,4 @@ group
mode mode
owner owner
parents parents
recursive

View file

@ -1,3 +1,6 @@
1.3.3:
* Add --recursive to __directory
1.3.2: 2011-03-21 1.3.2: 2011-03-21
* Add --source to __motd * Add --source to __motd
* Add --preseed to __package_apt * Add --preseed to __package_apt