From 19b7d1c70169028d60ab17b6223d025ab00c38f6 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 4 Jan 2016 16:29:40 +0000 Subject: [PATCH] Flip pkgs/dist-git over to use the gitolite Alias feature. --- roles/distgit/templates/genacls.pkgdb | 14 -------------- roles/distgit/templates/genacls.sh | 27 --------------------------- roles/distgit/templates/gitolite.rc | 6 ------ 3 files changed, 47 deletions(-) diff --git a/roles/distgit/templates/genacls.pkgdb b/roles/distgit/templates/genacls.pkgdb index 8c88207cd7..8633090d7a 100644 --- a/roles/distgit/templates/genacls.pkgdb +++ b/roles/distgit/templates/genacls.pkgdb @@ -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) diff --git a/roles/distgit/templates/genacls.sh b/roles/distgit/templates/genacls.sh index b43a8330eb..b96b3b2541 100644 --- a/roles/distgit/templates/genacls.sh +++ b/roles/distgit/templates/genacls.sh @@ -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 diff --git a/roles/distgit/templates/gitolite.rc b/roles/distgit/templates/gitolite.rc index c5e1bbea55..5f6d41a88c 100644 --- a/roles/distgit/templates/gitolite.rc +++ b/roles/distgit/templates/gitolite.rc @@ -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.