From b973657197c94e82c663f874b10a4220d6383500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Mon, 8 Jun 2020 16:33:38 +0200 Subject: [PATCH] gather: handle mirrorlist in kickstart MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merges: https://pagure.io/pungi/pull-request/1406 Signed-off-by: Frédéric Pierret (fepitre) --- pungi/scripts/pungi_gather.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pungi/scripts/pungi_gather.py b/pungi/scripts/pungi_gather.py index 01538e98..22cebe13 100644 --- a/pungi/scripts/pungi_gather.py +++ b/pungi/scripts/pungi_gather.py @@ -125,23 +125,34 @@ def main(ns, persistdir, cachedir): if ks_repo.name not in gather_opts.lookaside_repos: continue - if not getattr(ks_repo, "metalink", False): - dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl, enablegroups=False) - else: + if getattr(ks_repo, "metalink", False): dnf_obj.add_repo( ks_repo.name, ks_repo.baseurl, enablegroups=False, metalink=ks_repo.metalink, ) + elif getattr(ks_repo, "mirrorlist", False): + dnf_obj.add_repo( + ks_repo.name, + ks_repo.baseurl, + enablegroups=False, + mirrorlist=ks_repo.mirrorlist, + ) + else: + dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl, enablegroups=False) for ks_repo in ksparser.handler.repo.repoList: if ks_repo.name in gather_opts.lookaside_repos: continue - if not getattr(ks_repo, "metalink", False): - dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl) - else: + if getattr(ks_repo, "metalink", False): dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl, metalink=ks_repo.metalink) + elif getattr(ks_repo, "mirrorlist", False): + dnf_obj.add_repo( + ks_repo.name, ks_repo.baseurl, mirrorlist=ks_repo.mirrorlist + ) + else: + dnf_obj.add_repo(ks_repo.name, ks_repo.baseurl) with Profiler("DnfWrapper.fill_sack()"): dnf_obj.fill_sack(load_system_repo=False, load_available_repos=True)