add owner/group support to __git

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-12-05 23:16:03 +01:00
parent ad1f0f77b8
commit 3167ececc6
2 changed files with 20 additions and 3 deletions

View file

@ -26,7 +26,22 @@ __package git --state present
state_should=present
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
[ -f "$__object/parameter/owner" ] && dirparams="$dirparams --owner $(cat "$__object/parameter/owner")"
[ -f "$__object/parameter/group" ] && dirparams="$dirparams --group $(cat "$__object/parameter/group")"
# Let __directory handle removal of git repos
if [ "$state_should" = absent ]; then
case "$state_should" in
present)
__directory "$__object_id" --state present $dirparams --recursive
;;
absent)
__directory "$__object_id" --state absent
fi
;;
*)
echo "Unknown state: $state_should" >&2
exit 1
;;
esac

View file

@ -1,2 +1,4 @@
state
branch
group
owner