Stop showing retired repos in cgit
There are projects that are no-longer with us. Let's not broadcast them to the world in our cgit mirrors. Change-Id: Ie2d66fb8f41dd7035a209b48721b08c4f55fd75a
This commit is contained in:
parent
f12da78132
commit
0db52843ed
|
@ -61,9 +61,10 @@ def main():
|
||||||
'DEFAULT_ORG is set.' % project)
|
'DEFAULT_ORG is set.' % project)
|
||||||
(org, name) = (DEFAULT_ORG, project)
|
(org, name) = (DEFAULT_ORG, project)
|
||||||
description = entry.get('description', name)
|
description = entry.get('description', name)
|
||||||
|
retired = entry.get('acl-config', '').endswith('retired.config')
|
||||||
assert project not in names
|
assert project not in names
|
||||||
names.add(project)
|
names.add(project)
|
||||||
gitorgs.setdefault(org, []).append((name, description))
|
gitorgs.setdefault(org, []).append((name, description, retired))
|
||||||
if SCRATCH_SUBPATH:
|
if SCRATCH_SUBPATH:
|
||||||
assert SCRATCH_SUBPATH not in gitorgs
|
assert SCRATCH_SUBPATH not in gitorgs
|
||||||
scratch_path = os.path.join(REPO_PATH, SCRATCH_SUBPATH)
|
scratch_path = os.path.join(REPO_PATH, SCRATCH_SUBPATH)
|
||||||
|
@ -72,7 +73,7 @@ def main():
|
||||||
if not os.path.isdir(scratch_dir):
|
if not os.path.isdir(scratch_dir):
|
||||||
os.makedirs(scratch_dir)
|
os.makedirs(scratch_dir)
|
||||||
projects = gitorgs[org]
|
projects = gitorgs[org]
|
||||||
for (name, description) in projects:
|
for (name, description, retired) in projects:
|
||||||
scratch_repo = "%s.git" % os.path.join(scratch_dir, name)
|
scratch_repo = "%s.git" % os.path.join(scratch_dir, name)
|
||||||
subprocess.call(['git', 'init', '--bare', scratch_repo])
|
subprocess.call(['git', 'init', '--bare', scratch_repo])
|
||||||
subprocess.call(['chown', '-R', '%s:%s'
|
subprocess.call(['chown', '-R', '%s:%s'
|
||||||
|
@ -89,12 +90,15 @@ def main():
|
||||||
org_dir = os.path.join(REPO_PATH, org)
|
org_dir = os.path.join(REPO_PATH, org)
|
||||||
projects = gitorgs[org]
|
projects = gitorgs[org]
|
||||||
projects.sort()
|
projects.sort()
|
||||||
for (name, description) in projects:
|
for (name, description, retired) in projects:
|
||||||
|
if not retired:
|
||||||
project_repo = "%s.git" % os.path.join(org_dir, name)
|
project_repo = "%s.git" % os.path.join(org_dir, name)
|
||||||
cgit_file.write('\n')
|
cgit_file.write('\n')
|
||||||
cgit_file.write('repo.url=%s/%s\n' % (org, name))
|
cgit_file.write('repo.url=%s/%s\n' % (org, name))
|
||||||
cgit_file.write('repo.path=%s/\n' % (project_repo))
|
cgit_file.write('repo.path=%s/\n' % (project_repo))
|
||||||
cgit_file.write('repo.desc=%s\n' % (clean_string(description)))
|
cgit_file.write('repo.desc=%s\n' % (description))
|
||||||
|
cgit_file.write(
|
||||||
|
'repo.desc=%s\n' % (clean_string(description)))
|
||||||
if not os.path.exists(project_repo):
|
if not os.path.exists(project_repo):
|
||||||
subprocess.call(['git', 'init', '--bare', project_repo])
|
subprocess.call(['git', 'init', '--bare', project_repo])
|
||||||
subprocess.call(['chown', '-R', '%s:%s'
|
subprocess.call(['chown', '-R', '%s:%s'
|
||||||
|
|
Loading…
Reference in New Issue