From dd2a3cd647392597afff5cbb9c5c4e5dac85d379 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 21 Nov 2022 09:42:25 -0800 Subject: [PATCH] Update to 1.31.0. Fixes rhbz#2144498 --- .gitignore | 1 + 3555.patch | 35 ------------ 3558.patch | 155 ----------------------------------------------------- koji.spec | 13 ++--- sources | 2 +- 5 files changed, 7 insertions(+), 199 deletions(-) delete mode 100644 3555.patch delete mode 100644 3558.patch diff --git a/.gitignore b/.gitignore index 42c4921..db5fed2 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ koji-1.4.0.tar.bz2 /koji-1.29.1.tar.bz2 /koji-1.30.0.tar.bz2 /koji-1.30.1.tar.bz2 +/koji-1.31.0.tar.bz2 diff --git a/3555.patch b/3555.patch deleted file mode 100644 index 797ef5d..0000000 --- a/3555.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 18bbb5b21d4da8120fb9f3193248dd6faa915222 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Oct 17 2022 12:39:48 +0000 -Subject: fix include path - - -Related: https://pagure.io/koji/issue/3553 - ---- - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 42aa707..abb5511 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -197,16 +197,17 @@ class KiwiCreateImageTask(BaseBuildTask): - for inc_node in image.getElementsByTagName('include'): - path = inc_node.getAttribute('from') - if path.startswith('this://'): -- path = koji.util.joinpath(desc_path, path[7:]) -+ path = koji.util.joinpath(os.path.dirname(desc_path), path[7:]) - else: - # we want to reject other protocols, e.g. file://, https:// - # reachingoutside of repo - raise koji.GenericError(f"Unhandled include protocol in include path: {path}.") - inc = xml.dom.minidom.parse(path) # nosec - # every included xml has image root element again -- for node in inc.getElementsByTagName('image').childNodes: -+ for node in list(inc.getElementsByTagName('image')[0].childNodes): - if node.nodeName != 'repository': - image.appendChild(node) -+ image.removeChild(inc_node) - - # remove remaining old repos - for old_repo in image.getElementsByTagName('repository'): - diff --git a/3558.patch b/3558.patch deleted file mode 100644 index 03fb1ab..0000000 --- a/3558.patch +++ /dev/null @@ -1,155 +0,0 @@ -From e6a9553e9c5850c8c1b9361f84f2f9dbb426ef4c Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Oct 25 2022 10:25:49 +0000 -Subject: kiwi: propagate --type option - - -Related: https://pagure.io/koji/issue/3556 - ---- - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 42aa707..7d6f6e7 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -325,11 +325,11 @@ class KiwiCreateImageTask(BaseBuildTask): - 'user_id': self.taskinfo['owner'], - 'channel': self.session.getChannel(self.taskinfo['channel_id'], - strict=True)['name'], -- 'scratch': self.opts.get('scratch') -+ 'scratch': self.opts.get('scratch', False) - }) - logfile = os.path.join(self.workdir, 'checkout-%s.log' % arch) - self.run_callbacks('preSCMCheckout', scminfo=scm.get_info(), -- build_tag=build_tag, scratch=self.opts.get('scratch')) -+ build_tag=build_tag, scratch=self.opts.get('scratch', False)) - scmdir = broot.tmpdir() - koji.ensuredir(scmdir) - scmsrcdir = scm.checkout(scmdir, self.session, -@@ -337,7 +337,7 @@ class KiwiCreateImageTask(BaseBuildTask): - self.run_callbacks("postSCMCheckout", - scminfo=scm.get_info(), - build_tag=build_tag, -- scratch=self.opts.get('scratch'), -+ scratch=self.opts.get('scratch', False), - srcdir=scmsrcdir) - - # user repos -@@ -365,6 +365,8 @@ class KiwiCreateImageTask(BaseBuildTask): - cmd = ['kiwi-ng'] - if self.opts.get('profile'): - cmd.extend(['--profile', self.opts['profile']]) -+ if self.opts.get('type'): -+ cmd.extend(['--type', self.opts['type']]) - target_dir = '/builddir/result/image' - cmd.extend([ - '--kiwi-file', os.path.basename(desc), # global option for image/system commands -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 8786b13..07125d7 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -27,6 +27,7 @@ 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("--type", help="Override default build type from description") - 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", -@@ -46,28 +47,33 @@ def handle_kiwi_build(goptions, session, args): - target, scm, path = args - - activate_session(session, goptions) -- - kwargs = { -- 'scratch': options.scratch, -- 'optional_arches': [canonArch(arch) -- for arch in options.optional_arches.split(',') -- if arch], -- 'profile': options.kiwi_profile, -- 'release': options.release, -- 'make_prep': options.make_prep, -+ 'arches': [], -+ 'target': target, -+ 'desc_url': scm, -+ 'desc_path': path, - } -- -- arches = [] -+ if options.scratch: -+ kwargs['scratch'] = True -+ if options.optional_arches: -+ kwargs['optional_arches'] = [ -+ canonArch(arch) -+ for arch in options.optional_arches.split(',') -+ if arch] -+ if options.kiwi_profile: -+ kwargs['profile'] = options.kiwi_profile, -+ if options.release: -+ kwargs['release'] = options.release -+ if options.make_prep: -+ kwargs['make_prep'] = True -+ if options.type: -+ kwargs['type'] = options.type - if options.arches: -- arches = [canonArch(arch) for arch in options.arches] -+ kwargs['arches'] = [canonArch(arch) for arch in options.arches] -+ if options.repo: -+ kwargs['repos'] = options.repo - -- task_id = session.kiwiBuild( -- target=target, -- arches=arches, -- desc_url=scm, -- desc_path=path, -- repos=options.repo, -- **kwargs) -+ task_id = session.kiwiBuild(**kwargs) - - if not goptions.quiet: - print("Created task: %d" % task_id) -diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py -index 79da38a..17b8e8e 100644 ---- a/plugins/hub/kiwi.py -+++ b/plugins/hub/kiwi.py -@@ -16,7 +16,8 @@ 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): -+ scratch=False, priority=None, make_prep=False, repos=None, release=None, -+ type=None): - context.session.assertPerm('image') - for i in [desc_url, desc_path, profile, release]: - if i is not None: -@@ -42,14 +43,21 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile - 'only admins may create high-priority tasks') - taskOpts['priority'] = koji.PRIO_DEFAULT + priority - -- opts = { -- 'optional_arches': optional_arches, -- 'profile': profile, -- 'scratch': bool(scratch), -- 'release': release, -- 'repos': repos or [], -- 'make_prep': bool(make_prep), -- } -+ opts = {} -+ if scratch: -+ opts['scratch'] = True -+ if profile: -+ opts['profile'] = profile -+ if release: -+ opts['release'] = release -+ if optional_arches: -+ opts['optional_arches'] = optional_arches, -+ if repos: -+ opts['repos'] = repos -+ if make_prep: -+ opts['make_prep'] = True -+ if type: -+ opts['type'] = type - return kojihub.make_task('kiwiBuild', - [target, arches, desc_url, desc_path, opts], - **taskOpts) - diff --git a/koji.spec b/koji.spec index 8bce502..9f805ef 100644 --- a/koji.spec +++ b/koji.spec @@ -8,20 +8,14 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.30.1 -Release: 2%{?dist} +Version: 1.31.0 +Release: 1%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 -# Proposed upstream -## From: https://pagure.io/koji/pull-request/3555 -Patch1: 3555.patch -## From: https://pagure.io/koji/pull-request/3558 -Patch2: 3558.patch - # Not upstreamable Patch100: fedora-config.patch @@ -353,6 +347,9 @@ done %systemd_postun kojira.service %changelog +* Mon Nov 21 2022 Kevin Fenzi - 1.31.0-1 +- Update to 1.31.0. Fixes rhbz#2144498 + * Tue Oct 25 2022 Neal Gompa - 1.30.1-2 - Backport more fixes for kiwibuild command for CBS diff --git a/sources b/sources index 6e850c3..f5a1c63 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (koji-1.30.1.tar.bz2) = d5b0ca21c8f09a6346273c449f643a93a1edaabea82ea6d19aeba057c1d770c980f28545f42cb6bb2f28e8e20784b7c7c65f4bf2ce4957138f86bbab7925ee4b +SHA512 (koji-1.31.0.tar.bz2) = 8be8e72182f1c33dea7d308708f71a9c6bcfe896348c1ccc640a07a216070cb0951ee8dfc103897239a687dbd54c5544bc29cbb15ca09083852e3aa428f03887