|
41 | 41 | def _subst_source_recursively(data: T, name: str) -> T: |
42 | 42 | if isinstance(data, str): |
43 | 43 | if '{source}' in data: |
44 | | - warnings.warn('{source} substitution in repo config', DeprecationWarning) |
| 44 | + raise RuntimeError('{source} substitution in repo config') |
45 | 45 | return data.replace('{source}', name) # type: ignore |
46 | 46 | elif isinstance(data, list): |
47 | 47 | return [_subst_source_recursively(item, name) for item in data] # type: ignore |
@@ -155,24 +155,25 @@ def __init__(self, repositories_config: YamlConfig) -> None: |
155 | 155 | if sourcedata.get('disabled', False): |
156 | 156 | continue |
157 | 157 |
|
158 | | - for name in _listify(sourcedata['name']): |
159 | | - # if there are multiple names, clone source data for each of them |
160 | | - processed_sourcedata = _subst_source_recursively(copy.deepcopy(sourcedata), name) |
161 | | - sources.append( |
162 | | - Source( |
163 | | - name=name, |
164 | | - subrepo=processed_sourcedata.get('subrepo'), |
165 | | - fetcher=processed_sourcedata['fetcher'], |
166 | | - parser=processed_sourcedata['parser'], |
167 | | - packagelinks=[ |
168 | | - PackageLink( |
169 | | - type=LinkType.from_string(linkdata['type']), |
170 | | - url=linkdata['url'], |
171 | | - priority=linkdata.get('priority', 1), |
172 | | - ) |
173 | | - for linkdata in processed_sourcedata.get('packagelinks', [])], |
174 | | - ) |
| 158 | + if not isinstance(sourcedata['name'], str): |
| 159 | + raise RuntimeError('loops over source name are not supported') |
| 160 | + |
| 161 | + processed_sourcedata = _subst_source_recursively(copy.deepcopy(sourcedata), '') |
| 162 | + sources.append( |
| 163 | + Source( |
| 164 | + name=sourcedata['name'], |
| 165 | + subrepo=processed_sourcedata.get('subrepo'), |
| 166 | + fetcher=processed_sourcedata['fetcher'], |
| 167 | + parser=processed_sourcedata['parser'], |
| 168 | + packagelinks=[ |
| 169 | + PackageLink( |
| 170 | + type=LinkType.from_string(linkdata['type']), |
| 171 | + url=linkdata['url'], |
| 172 | + priority=linkdata.get('priority', 1), |
| 173 | + ) |
| 174 | + for linkdata in processed_sourcedata.get('packagelinks', [])], |
175 | 175 | ) |
| 176 | + ) |
176 | 177 |
|
177 | 178 | extra_groups.add(sourcedata['fetcher']['class']) |
178 | 179 | extra_groups.add(sourcedata['parser']['class']) |
|
0 commit comments