(http) gl-setup changes...

- only admin name needed, not pubkey file
  - setup HOME from GITOLITE_HTTP_HOME
This commit is contained in:
Sitaram Chamarty 2010-09-05 18:48:29 +05:30
parent f4e011226a
commit ec329ca13f

View file

@ -21,14 +21,21 @@ GL_PACKAGE_CONF=/tmp/share/gitolite/conf
die() { echo "$@"; exit 1; } die() { echo "$@"; exit 1; }
pubkey_file=$1
admin_name= if [ -n "$GITOLITE_HTTP_HOME" ]
if [ -n "$pubkey_file" ]
then then
echo $pubkey_file | grep '.pub$' >/dev/null || die "$pubkey_file must end in .pub" HOME=$GITOLITE_HTTP_HOME
[ -f $pubkey_file ] || die "cant find $pubkey_file" admin_name=$1
admin_name=` basename $pubkey_file .pub` else
echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name" pubkey_file=$1
admin_name=
if [ -n "$pubkey_file" ]
then
echo $pubkey_file | grep '.pub$' >/dev/null || die "$pubkey_file must end in .pub"
[ -f $pubkey_file ] || die "cant find $pubkey_file"
admin_name=` basename $pubkey_file .pub`
echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name"
fi
fi fi
if [ -f $HOME/.gitolite.rc ] if [ -f $HOME/.gitolite.rc ]
@ -49,7 +56,9 @@ then
fi fi
rm -f .newvars .oldvars .diffvars rm -f .newvars .oldvars .diffvars
else else
[ -n "$pubkey_file" ] || die "looks like first run -- I need a pubkey file" [ -n "$GITOLITE_HTTP_HOME" ] || [ -n "$pubkey_file" ] || die "looks like first run -- I need a pubkey file"
[ -z "$GITOLITE_HTTP_HOME" ] || [ -n "$admin_name" ] || die "looks like first run -- I need an admin name"
cp $GL_PACKAGE_CONF/example.gitolite.rc $HOME/.gitolite.rc cp $GL_PACKAGE_CONF/example.gitolite.rc $HOME/.gitolite.rc
fi fi