From b13d481d56059fd51a8f9109d0d64d3f11fcbccc Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Mon, 25 Mar 2024 11:33:41 +0100 Subject: [PATCH 2/6] kiwi: option for not using buildroot repo Related: https://pagure.io/koji/issue/4062 --- plugins/builder/kiwi.py | 3 +-- plugins/cli/kiwi.py | 6 ++++++ plugins/hub/kiwi.py | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py index d5d4fbdc..a878ad56 100644 --- a/plugins/builder/kiwi.py +++ b/plugins/builder/kiwi.py @@ -351,8 +351,7 @@ class KiwiCreateImageTask(BaseBuildTask): # user repos repos = self.opts.get('repos', []) - # buildroot repo if user repos not defined - if repos == []: + if self.opts.get('use_buildroot_repo', True): path_info = koji.PathInfo(topdir=self.options.topurl) repopath = path_info.repo(repo_info['id'], target_info['build_tag_name']) baseurl = '%s/%s' % (repopath, arch) diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py index f0172575..6611df73 100644 --- a/plugins/cli/kiwi.py +++ b/plugins/cli/kiwi.py @@ -34,6 +34,10 @@ def handle_kiwi_build(goptions, session, args): parser.add_option("--result-bundle-name-format", help="Override default bundle name format") parser.add_option("--make-prep", action="store_true", default=False, help="Run 'make prep' in checkout before starting the build") + parser.add_option("--no-buildroot-repo", action="store_false", + dest="use_buildroot_repo", default=True, + help="Don't add buildroot repo to installation sources, " + "use only those provided by --repo option.") parser.add_option("--can-fail", action="store", dest="optional_arches", metavar="ARCH1,ARCH2,...", default="", help="List of archs which are not blocking for build " @@ -80,6 +84,8 @@ def handle_kiwi_build(goptions, session, args): kwargs['arches'] = [canonArch(arch) for arch in options.arches] if options.repo: kwargs['repos'] = options.repo + if not options.use_buildroot_repo: + kwargs['use_buildroot_repo'] = False task_id = session.kiwiBuild(**kwargs) diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py index 15f352cc..cd03ab42 100644 --- a/plugins/hub/kiwi.py +++ b/plugins/hub/kiwi.py @@ -17,7 +17,7 @@ koji.tasks.LEGACY_SIGNATURES['createKiwiImage'] = [ @export def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None, scratch=False, priority=None, make_prep=False, repos=None, release=None, - type=None, type_attr=None, result_bundle_name_format=None): + type=None, type_attr=None, result_bundle_name_format=None, use_buildroot_repo=True): context.session.assertPerm('image') for i in [desc_url, desc_path, profile, release]: if i is not None: @@ -62,6 +62,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile opts['make_prep'] = True if type: opts['type'] = type + if not use_buildroot_repo: + opts['use_buildroot_repo'] = False if type_attr: opts['type_attr'] = type_attr if result_bundle_name_format: -- 2.46.0