add update-cloneurls script for git server administration

This commit is contained in:
Josh Holtrop 2011-04-19 18:04:26 -04:00
parent 4bc0165fde
commit 020dd3b160

14
update-cloneurls Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
import os
repos = '/var/git/git/repositories'
base = 'git://holtrop.homelinux.com/'
for d in os.listdir(repos):
repo_path = repos + '/' + d
if os.path.isdir(repo_path):
url_path = repo_path + '/cloneurl'
if not os.path.isfile(url_path):
f = file(url_path, 'w')
f.write(base + d)