2010-06-01 12:57:33 +02:00
|
|
|
#!/bin/sh
|
2010-04-24 19:30:38 +02:00
|
|
|
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
|
|
|
|
delete=$1
|
|
|
|
|
|
|
|
get_rights_and_owner $delete
|
2010-08-20 06:15:05 +02:00
|
|
|
|
|
|
|
# please choose one alternative and delete the other para
|
|
|
|
|
|
|
|
# alternative 1 -- only creator can delete
|
2010-06-01 12:57:33 +02:00
|
|
|
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
|
2010-04-24 19:30:38 +02:00
|
|
|
|
2010-08-20 06:15:05 +02:00
|
|
|
# alternative 2 -- creator or anyone with W access to admin repo can delete
|
|
|
|
[ "$owner" = "$GL_USER" ] || {
|
2010-09-03 05:18:51 +02:00
|
|
|
# but only if it is wild
|
|
|
|
[ "$owner" = "<gitolite>" ] && die "$delete is not a wild repo"
|
2010-08-20 06:15:05 +02:00
|
|
|
get_rights_and_owner gitolite-admin
|
|
|
|
[ -z "$perm_write" ] && die "$delete is not yours to delete and you're not the admin"
|
|
|
|
}
|
|
|
|
|
2010-04-24 19:30:38 +02:00
|
|
|
cd $GL_REPO_BASE_ABS
|
|
|
|
rm -rf $delete.git
|
2010-10-06 16:33:50 +02:00
|
|
|
|
|
|
|
cd $HOME
|
|
|
|
PROJECTS_LIST=$(perl -e 'do ".gitolite.rc"; print $PROJECTS_LIST')
|
|
|
|
export delete
|
|
|
|
perl -ni -e 'print unless /^\Q$ENV{delete}.git\E$/' $PROJECTS_LIST
|