gather: Port hybrid method

Update the code to consume multiple source repos.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-07-29 14:43:56 +02:00
parent a446593698
commit 6fa478e688

View File

@ -100,7 +100,7 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase):
return self.package_maps[arch]
def _prepare_packages(self):
repo_path = self.compose.paths.work.arch_repo(arch=self.arch)
for repo_path in self.get_repos():
md = cr.Metadata()
md.locate_and_load_xml(repo_path)
for key in md.keys():
@ -183,6 +183,7 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase):
**kwargs
):
self.arch = arch
self.variant = variant
self.valid_arches = get_valid_arches(arch, multilib=True)
self.package_sets = package_sets
@ -220,8 +221,16 @@ class GatherMethodHybrid(pungi.phases.gather.method.GatherMethodBase):
)
# maybe check invalid sigkeys
def get_repos(self):
repos = []
for pkgset in self.package_sets:
if self.variant.pkgsets and pkgset.name not in self.variant.pkgsets:
continue
repos.append(pkgset.paths[self.arch])
return repos
def run_solver(self, variant, arch, packages, platform, filter_packages):
repos = [self.compose.paths.work.arch_repo(arch=arch)]
repos = self.get_repos()
results = set()
result_modules = set()