verify that the submodules are checked out and clean use `git submodule update --init`; on failure
()
| 127 | |
| 128 | |
| 129 | def check_submodules(): |
| 130 | """ verify that the submodules are checked out and clean |
| 131 | use `git submodule update --init`; on failure |
| 132 | """ |
| 133 | if not os.path.exists('.git'): |
| 134 | return |
| 135 | with open('.gitmodules') as f: |
| 136 | for line in f: |
| 137 | if 'path' in line: |
| 138 | p = line.split('=')[-1].strip() |
| 139 | if not os.path.exists(p): |
| 140 | raise ValueError('Submodule {} missing'.format(p)) |
| 141 | |
| 142 | proc = subprocess.Popen(['git', 'submodule', 'status'], |
| 143 | stdout=subprocess.PIPE) |
| 144 | status, _ = proc.communicate() |
| 145 | status = status.decode("ascii", "replace") |
| 146 | for line in status.splitlines(): |
| 147 | if line.startswith('-') or line.startswith('+'): |
| 148 | raise ValueError('Submodule not clean: {}'.format(line)) |
| 149 | |
| 150 | |
| 151 | class concat_license_files(): |
no test coverage detected