2010-06-01 16:27:33 +05:30
|
|
|
#!/bin/sh
|
2010-04-24 23:00:38 +05:30
|
|
|
|
|
|
|
# please make sure this file is NOT chmod +x
|
|
|
|
|
|
|
|
die() { echo "$@"; exit 1; }
|
|
|
|
|
|
|
|
get_rights_and_owner() {
|
|
|
|
local ans
|
2010-05-31 20:39:45 +05:30
|
|
|
ans=$(perl -I$GL_BINDIR -Mgitolite -e 'cli_repo_rights("'$1'")')
|
2010-04-24 23:00:38 +05:30
|
|
|
|
|
|
|
# set shell variables as needed
|
|
|
|
owner=${ans#* }
|
|
|
|
rights=${ans% *}
|
2010-06-01 16:27:33 +05:30
|
|
|
echo $rights | grep C >/dev/null 2>&1 && perm_create=yes || perm_create=
|
|
|
|
echo $rights | grep R >/dev/null 2>&1 && perm_read=yes || perm_read=
|
|
|
|
echo $rights | grep W >/dev/null 2>&1 && perm_write=yes || perm_write=
|
2010-04-24 23:00:38 +05:30
|
|
|
}
|