diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py index 369071ef..2ac5cb3b 100644 --- a/plugins/builder/kiwi.py +++ b/plugins/builder/kiwi.py @@ -351,12 +351,12 @@ class KiwiCreateImageTask(BaseBuildTask): # user repos repos = self.opts.get('repos', []) - # buildroot repo - 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) - self.logger.debug('BASEURL: %s' % baseurl) - repos.append(baseurl) + if self.opts.get('use_buildroot_repo', False): + 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) + self.logger.debug('BASEURL: %s' % baseurl) + repos.append(baseurl) base_path = os.path.dirname(desc_path) if opts.get('make_prep'): diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py index f0172575..02958373 100644 --- a/plugins/cli/kiwi.py +++ b/plugins/cli/kiwi.py @@ -7,6 +7,7 @@ from koji_cli.lib import ( _running_in_bg, activate_session, watch_tasks, + warn, ) @@ -34,6 +35,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("--buildroot-repo", action="store_true", + dest="use_buildroot_repo", default=False, + help="Add buildroot repo to installation sources. This is off by default, " + "but if there is no --repo used, it will be turned on automatically.") parser.add_option("--can-fail", action="store", dest="optional_arches", metavar="ARCH1,ARCH2,...", default="", help="List of archs which are not blocking for build " @@ -81,6 +86,14 @@ def handle_kiwi_build(goptions, session, args): if options.repo: kwargs['repos'] = options.repo + if session.hub_version < (1, 35, 0): + warn("hub version is < 1.35, buildroot repo is always used in addition to specified repos") + elif options.use_buildroot_repo: + kwargs['use_buildroot_repo'] = True + elif not options.repo: + warn("no repos given, using buildroot repo") + kwargs['use_buildroot_repo'] = True + task_id = session.kiwiBuild(**kwargs) if not goptions.quiet: diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py index 15f352cc..81852e52 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 use_buildroot_repo: + opts['use_buildroot_repo'] = True if type_attr: opts['type_attr'] = type_attr if result_bundle_name_format: