#!/usr/bin/python import py from uconf import svnconf print 'reading svn-access.conf' af = svnconf.parser(py.path.local('/cell/svn-access.conf')) print 'converting to authz' az = af.toauthz() # this is the 'new way', create an Apache config file snippet to create print 'converting to htaccessconf' htconf = af.tohtaccessconf('/viewvc', 'viewvc', '/etc/apache2/conf/svnusers.passwd') # XXX this is the 'old way', creating groups for each dir and then updating # pwdtrigger.conf """ print 'updating system (adding groups) from authz info' az.updatesystemgroups() print 'reading pwdtrigger' pwt = svnconf.pwdtrigger(py.path.local('pwdtrigger.conf')) print 'updating pwdtrigger from authz' az.updatepwdtrigger(pwt) print 'saving pwdtrigger' pwt.save() print '(saved data:' print '-' * 79 print str(pwt) print '-' * 79 print ')' """ print 'saving authz' target = py.path.local('/cell/.apache2-svn.authz') az.write(target) if py.std.os.getuid() == 0: target.chmod(0664) print '(saved data:' print '-' * 79 print str(az) print '-' * 79 print ')' print 'saving viewvc httpd auth config' target = py.path.local('/cell/.apache2-viewvc-auth.inc') htconf.write(target) print '(saved data:' print '-' * 79 print str(htconf) print '-' * 79 print ')'