From 7521198a8c46fdd26587d6749755a17950350493 Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 19 2022 14:26:32 +0000 Subject: optional "make prep" --- diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py index d1bcc2f..1d9f52a 100644 --- a/plugins/builder/kiwi.py +++ b/plugins/builder/kiwi.py @@ -344,6 +344,12 @@ class KiwiCreateImageTask(BaseBuildTask): self.logger.debug('BASEURL: %s' % baseurl) repos.append(baseurl) + if opts.get('make_prep'): + cmd = ['make', 'prep'] + rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) + if rv: + raise koji.GenericError("Preparation step failed") + path = os.path.join(scmsrcdir, desc_path) desc, types = self.prepareDescription(path, name, version, repos) self.uploadFile(desc) diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py index 7e7af2c..8786b13 100644 --- a/plugins/cli/kiwi.py +++ b/plugins/cli/kiwi.py @@ -27,6 +27,8 @@ def handle_kiwi_build(goptions, session, args): help="Do not display progress of the upload") parser.add_option("--kiwi-profile", action="store", default=None, help="Select profile from description file") + parser.add_option("--make-prep", action="store_true", default=False, + help="Run 'make prep' in checkout before starting the build") parser.add_option("--can-fail", action="store", dest="optional_arches", metavar="ARCH1,ARCH2,...", default="", help="List of archs which are not blocking for build " @@ -52,6 +54,7 @@ def handle_kiwi_build(goptions, session, args): if arch], 'profile': options.kiwi_profile, 'release': options.release, + 'make_prep': options.make_prep, } arches = [] diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py index 3adf6e9..fd4877c 100644 --- a/plugins/hub/kiwi.py +++ b/plugins/hub/kiwi.py @@ -16,7 +16,7 @@ koji.tasks.LEGACY_SIGNATURES['createKiwiImage'] = [ @export def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None, - scratch=False, priority=None, repos=None, release=None): + scratch=False, priority=None, make_prep=False, repos=None, release=None): context.session.assertPerm('image') taskOpts = { 'channel': 'image', @@ -34,6 +34,7 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile 'scratch': scratch, 'release': release, 'repos': repos or [], + 'make_prep': make_prep, } return kojihub.make_task('kiwiBuild', [target, arches, desc_url, desc_path, opts],