(projects)
| 39 | |
| 40 | |
| 41 | def gen_gitmodules(projects): |
| 42 | path_template = "https://opendev.org/{project}" |
| 43 | short_projects = [] |
| 44 | for project in projects: |
| 45 | short = os.path.basename(project) |
| 46 | short_projects.append(short) |
| 47 | path = path_template.format(project=project) |
| 48 | if not os.path.isdir(short): |
| 49 | os.system('git submodule add {path}'.format(path=path)) |
| 50 | for existing in os.listdir('.'): |
| 51 | if not os.path.isdir(existing) or existing.startswith('.'): |
| 52 | continue |
| 53 | if existing not in short_projects: |
| 54 | os.system('git rm {existing}'.format(existing=existing)) |
| 55 | projects = sorted(projects) |
| 56 | with open(".gitmodules", 'w') as f: |
| 57 | for p in projects: |
| 58 | ns, name = p.split('/') |
| 59 | f.write(TEMPLATE % (name, name, p)) |
| 60 | |
| 61 | |
| 62 | def main(): |
no outgoing calls
no test coverage detected
searching dependent graphs…