(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,6 +21,12 @@ GL_PACKAGE_CONF=/tmp/share/gitolite/conf
die() { echo "$@"; exit 1; }
if [ -n "$GITOLITE_HTTP_HOME" ]
then
HOME=$GITOLITE_HTTP_HOME
admin_name=$1
else
pubkey_file=$1
admin_name=
if [ -n "$pubkey_file" ]
@ -30,6 +36,7 @@ then
admin_name=` basename $pubkey_file .pub`
echo $admin_name | grep '@' >/dev/null && die "please don't use '@' in the initial admin name"
fi
fi
if [ -f $HOME/.gitolite.rc ]
then
@ -49,7 +56,9 @@ then
fi
rm -f .newvars .oldvars .diffvars
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
fi