diff --git a/conf/type/__directory/gencode-remote b/conf/type/__directory/gencode-remote index 6d226aae..a5458b4b 100755 --- a/conf/type/__directory/gencode-remote +++ b/conf/type/__directory/gencode-remote @@ -36,6 +36,12 @@ if [ -f "$__object/parameter/parents" ]; then 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 if [ no = "$(cat "$__object/explorer/exists")" ]; then echo mkdir $mkdiropt \"$destination\" @@ -48,10 +54,10 @@ fi # Group if [ -f "$__object/parameter/group" ]; then - echo chgrp \"$(cat "$__object/parameter/group")\" \"$destination\" + echo chgrp $recursive \"$(cat "$__object/parameter/group")\" \"$destination\" fi # Owner if [ -f "$__object/parameter/owner" ]; then - echo chown \"$(cat "$__object/parameter/owner")\" \"$destination\" + echo chown $recursive \"$(cat "$__object/parameter/owner")\" \"$destination\" fi diff --git a/conf/type/__directory/man.text b/conf/type/__directory/man.text index 02a41754..8e1484de 100644 --- a/conf/type/__directory/man.text +++ b/conf/type/__directory/man.text @@ -32,6 +32,11 @@ owner:: parents:: 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 -------- @@ -45,6 +50,9 @@ __directory /etc --owner root --group root --mode 0755 # Create nfs service directory, including parents __directory /home/services/nfs --parents yes + +# Change permissions recursively +__directory /home/services --recursive yes --owner root --group root -------------------------------------------------------------------------------- diff --git a/conf/type/__directory/parameter/optional b/conf/type/__directory/parameter/optional index 752c3989..247e2f64 100644 --- a/conf/type/__directory/parameter/optional +++ b/conf/type/__directory/parameter/optional @@ -2,3 +2,4 @@ group mode owner parents +recursive diff --git a/doc/changelog b/doc/changelog index 5b6b03a9..f120e47d 100644 --- a/doc/changelog +++ b/doc/changelog @@ -1,3 +1,6 @@ +1.3.3: + * Add --recursive to __directory + 1.3.2: 2011-03-21 * Add --source to __motd * Add --preseed to __package_apt