Flip pkgs/dist-git over to use the gitolite Alias feature.

This commit is contained in:
Ralph Bean 2016-01-04 16:29:40 +00:00
parent 15dabba643
commit 19b7d1c701
3 changed files with 0 additions and 47 deletions

View file

@ -140,18 +140,4 @@ if __name__ == '__main__':
if masters:
print ' RWC = %s' % ' '.join(masters)
{% if env != 'staging' %}
# Bring backward compatibility while we keep the symlinks in place
# from the old to the new locations.
if key == 'rpms/':
print ''
print 'repo %s' % (pkg)
print '\n'.join(buffer)
for reserved in RESERVED:
print ' - %s = @all' % reserved
print ' RWC refs/tags/ = %s' % ' '.join(writers)
if masters:
print ' RWC = %s' % ' '.join(masters)
{% endif %}
sys.exit(0)

View file

@ -10,7 +10,6 @@ cd $TEMPDIR
# Then create the repos and branches on disk (if we need any new ones)
python /usr/local/bin/pkgdb_sync_git_branches.py
{% if env == 'staging' %}
# Leverage gitolite's Alias.pm feature to build backwards compat links
cat /etc/gitolite/RepoAliases.header > RepoAliases.pm
# Get all repos. Strip off 'rpms/'. Convert to perl mapping. Tack it on.
@ -19,40 +18,14 @@ grep rpms/ ./gitolite.conf | \
sed "s/.*/'&' => 'rpms\/&',/g" \
>> RepoAliases.pm
echo "};}1;" >> RepoAliases.pm
{% endif %}
# With that done, move the files into place and run compile
mv gitolite.conf /etc/gitolite/conf/
chown gen-acls:gen-acls -R /etc/gitolite/conf/
{% if env == 'staging' %}
mv RepoAliases.pm /etc/gitolite/RepoAliases.pm
chown gen-acls:gen-acls -R /etc/gitolite/RepoAliases.pm
{% endif %}
HOME=/srv/git /usr/bin/gitolite compile
{% if env != 'staging' %}
# After compiling, we have to stick some magic into the gl-conf files of
# every repo so that gitolite will understand our symlinks from rpms/
cd /srv/git/repositories
for repodir in *.git; do
glconf=$repodir/gl-conf;
# Strip off the '.git' on the end.
repo=${repodir::-4}
# Check which repo from gitolite.conf won the gitolite race.
if grep --quiet rpms/ $glconf; then
# ...and map things one way
echo '$one_config{"'$repo'"} = $one_config{"rpms/'$repo'"};' >> $glconf;
echo '$one_repo{"'$repo'"} = $one_repo{"rpms/'$repo'"};' >> $glconf;
else
# or map them the other way
echo '$one_config{"rpms/'$repo'"} = $one_config{"'$repo'"};' >> $glconf;
echo '$one_repo{"rpms/'$repo'"} = $one_repo{"'$repo'"};' >> $glconf;
fi
done
{% endif %}
cd /
rm -rf $TEMPDIR

View file

@ -13,12 +13,10 @@
# directly in the corresponding source file.
{% if env == 'staging' %}
# Hack!
# Pull in our repo aliases generated by genacls.sh
use lib ('/etc/gitolite/');
use RepoAliases qw( repo_aliases );
{% endif %}
%RC = (
@ -48,9 +46,7 @@ use RepoAliases qw( repo_aliases );
WRITERS => 1,
},
{% if env == 'staging' %}
REPO_ALIASES => repo_aliases(),
{% endif %}
# enable caching (currently only Redis). PLEASE RTFM BEFORE USING!!!
# CACHE => 'Redis',
@ -133,10 +129,8 @@ use RepoAliases qw( repo_aliases );
# no auto-create at all (don't forget to enable the 'create' command!)
'no-auto-create',
{% if env == 'staging' %}
# access a repo by another (possibly legacy) name
'Alias',
{% endif %}
# give some users direct shell access. See documentation in
# sts.html for details on the following two choices.