From be5a48a6ec46b3969bb7045d0f77edcf095371b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 28 May 2024 22:14:49 +0200 Subject: [PATCH 1/9] Fix FTBFS with Python 3.13 Fixes https://bugzilla.redhat.com/2280552 --- 4100.patch | 33 +++++++++++++++++++++++++++++++++ koji.spec | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 4100.patch diff --git a/4100.patch b/4100.patch new file mode 100644 index 0000000..dfc8227 --- /dev/null +++ b/4100.patch @@ -0,0 +1,33 @@ +From a241746b2a496540bb6cbe64a5b59eb5bb1c50a6 Mon Sep 17 00:00:00 2001 +From: Miro Hrončok +Date: May 28 2024 20:10:07 +0000 +Subject: setup.py: Fix version retrieval on Python 3.13+ + + +Accessing __version__ from locals() no longer works. + +This was reported to Python in https://github.com/python/cpython/issues/118888 +but according to Python developers, it: + + - is an intended change of behavior described in PEP 667 + - was an illegal usage that happens to work in a favored way to begin with + +--- + +diff --git a/setup.py b/setup.py +index 91f7d76..4d38c08 100755 +--- a/setup.py ++++ b/setup.py +@@ -25,8 +25,9 @@ def get_install_requires(): + + def get_version(): + cwd = os.path.dirname(__file__) +- exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read()) +- return locals()['__version__'] ++ lcls = {} ++ exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read(), None, lcls) ++ return lcls['__version__'] + + + def get_long_description(): + diff --git a/koji.spec b/koji.spec index 6b0306c..c0acfd6 100644 --- a/koji.spec +++ b/koji.spec @@ -33,6 +33,8 @@ Patch104: https://pagure.io/koji/c/0251961929a45ccae1d635b7e85a9d8826baf72d.patc Patch105: https://pagure.io/koji/c/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch # Add index for rpminfo Patch106: https://pagure.io/koji/pull-request/4026.patch +# setup.py: Fix version retrieval on Python 3.13+ +Patch107: https://pagure.io/koji/pull-request/4100.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} From ff4c42e37c63ffeb5a2a6850bfa672fbfa6691f9 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 5 Jun 2024 14:57:04 -0700 Subject: [PATCH 2/9] Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 Upgrade to 1.34.1. Fixes rhbz#2283973 --- .gitignore | 1 + koji.spec | 22 ++++++++++------------ sources | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 385e92f..5f0e2ed 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ koji-1.4.0.tar.bz2 /koji-1.33.0.tar.bz2 /koji-1.33.1.tar.bz2 /koji-1.34.0.tar.bz2 +/koji-1.34.1.tar.bz2 diff --git a/koji.spec b/koji.spec index c0acfd6..55638c6 100644 --- a/koji.spec +++ b/koji.spec @@ -8,33 +8,28 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.34.0 -Release: 3%{?dist} +Version: 1.34.1 +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 -# scm policy plugin - already upstreamed +# scm policy plugin - already upstreamed but not released yet Patch1: 1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch # Not upstreamable Patch100: fedora-config.patch # Use dnf5-compatible "group install" command # This should work on yum/dnf-4/dnf5 -Patch102: https://pagure.io/koji/pull-request/3974.patch +Patch101: https://pagure.io/koji/pull-request/3974.patch # noarch builds only happen on some arches # allows picking what arches will do noarch builds -Patch103: https://pagure.io/koji/pull-request/4013.patch -# oz size patch -# Drop passing a unit to oz so it can determine GiB vs GB -Patch104: https://pagure.io/koji/c/0251961929a45ccae1d635b7e85a9d8826baf72d.patch -# fix typo in refusal - already upstreamed -Patch105: https://pagure.io/koji/c/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch +Patch102: https://pagure.io/koji/pull-request/4013.patch # Add index for rpminfo -Patch106: https://pagure.io/koji/pull-request/4026.patch +Patch103: https://pagure.io/koji/pull-request/4026.patch # setup.py: Fix version retrieval on Python 3.13+ -Patch107: https://pagure.io/koji/pull-request/4100.patch +Patch104: https://pagure.io/koji/pull-request/4100.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} @@ -367,6 +362,9 @@ done %systemd_postun kojira.service %changelog +* Wed Jun 05 2024 Kevin Fenzi - 1.34.1-1 +- Upgrade to 1.34.1. Fixes rhbz#2283973 + * Fri Mar 22 2024 Kevin Fenzi - 1.34.0-3 - Add back in missing schema files. rhbz#2270743 diff --git a/sources b/sources index ce2e890..b15b58b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (koji-1.34.0.tar.bz2) = d3d8518dd038550ade20f99154ddbd804980d8880caccfd3ede6014ed3936fad0b5c7697921599fdd2e9d921392d4cac768b0312cb3013f79853f14e50391888 +SHA512 (koji-1.34.1.tar.bz2) = ed55e8c16239ba43e1b931d6b16523530ede77c087f93828e53f30aec9514e81d252adb7e64c1194f7fc4e9db33ee4e6c74841f07dfc688d6bb68bd9b7bd80b6 From 05da65fe789408ad1538716af8a4a91ab80c0ce9 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:50:27 +0200 Subject: [PATCH 3/9] Rebuilt for Python 3.13 --- koji.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/koji.spec b/koji.spec index 55638c6..13e0602 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.34.1 -Release: 1%{?dist} +Release: 2%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -362,6 +362,9 @@ done %systemd_postun kojira.service %changelog +* Fri Jun 07 2024 Python Maint - 1.34.1-2 +- Rebuilt for Python 3.13 + * Wed Jun 05 2024 Kevin Fenzi - 1.34.1-1 - Upgrade to 1.34.1. Fixes rhbz#2283973 From d784aa6a45d5a00d273ea46492e77c148b4af79b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 12:32:30 +0000 Subject: [PATCH 4/9] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- koji.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/koji.spec b/koji.spec index 13e0602..d060c0a 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.34.1 -Release: 2%{?dist} +Release: 3%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -362,6 +362,9 @@ done %systemd_postun kojira.service %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 1.34.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Fri Jun 07 2024 Python Maint - 1.34.1-2 - Rebuilt for Python 3.13 From 487e6dcdc6e20ca0720d3374f79eb626c2871507 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 22 Aug 2024 09:27:25 -0700 Subject: [PATCH 5/9] Backport PR #4157 to support overriding Kiwi image file name format --- ...-for-overriding-image-type-attribute.patch | 82 ++++++++++++++++++ ...-for-overriding-kiwi-image-file-name.patch | 83 +++++++++++++++++++ koji.spec | 9 +- 3 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 0001-kiwi-Add-support-for-overriding-image-type-attribute.patch create mode 100644 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch diff --git a/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch b/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch new file mode 100644 index 0000000..f31ad5c --- /dev/null +++ b/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch @@ -0,0 +1,82 @@ +From b22449c553b344fd3a1ee7cb49c769754ddfa347 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Sun, 11 Aug 2024 14:42:31 -0400 +Subject: [PATCH 1/2] kiwi: Add support for overriding image type attributes + +This allows setting things like the volume and application IDs +for ISO builds. +--- + plugins/builder/kiwi.py | 2 ++ + plugins/cli/kiwi.py | 5 +++++ + plugins/hub/kiwi.py | 6 +++++- + 3 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index a9d63cf0..99737f7c 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -389,6 +389,8 @@ class KiwiCreateImageTask(BaseBuildTask): + '--description', os.path.join(os.path.basename(scmsrcdir), base_path), + '--target-dir', target_dir, + ]) ++ for typeattr in self.opts.get('type_attr', []):: ++ cmd.extend(['--set-type-attr', typeattr]) + rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) + if rv: + raise koji.GenericError("Kiwi failed") +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 6e965c05..7e3e9771 100644 +--- a/plugins/cli/kiwi.py ++++ b/plugins/cli/kiwi.py +@@ -28,6 +28,9 @@ def handle_kiwi_build(goptions, session, args): + 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("--type-attr", action="append", default=[], ++ help="Override default attributes for the build type from description. " ++ "May be used multiple times.") + 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", +@@ -68,6 +71,8 @@ def handle_kiwi_build(goptions, session, args): + kwargs['make_prep'] = True + if options.type: + kwargs['type'] = options.type ++ if options.type_attr: ++ kwargs['type_attr'] = options.type_attr + if options.arches: + kwargs['arches'] = [canonArch(arch) for arch in options.arches] + if options.repo: +diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py +index 7b0c2f05..852cbad1 100644 +--- a/plugins/hub/kiwi.py ++++ b/plugins/hub/kiwi.py +@@ -17,13 +17,15 @@ 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=None, type_attr=None): + context.session.assertPerm('image') + for i in [desc_url, desc_path, profile, release]: + if i is not None: + kojihub.convert_value(i, cast=str, check_only=True) + if repos: + kojihub.convert_value(repos, cast=list, check_only=True) ++ if type_attr: ++ kojihub.convert_value(type_attr, cast=list, check_only=True) + kojihub.get_build_target(target, strict=True) + if isinstance(arches, list): + arches = " ".join(arches) +@@ -58,6 +60,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile + opts['make_prep'] = True + if type: + opts['type'] = type ++ if type_attr: ++ opts['type_attr'] = type_attr + return kojihub.make_task('kiwiBuild', + [target, arches, desc_url, desc_path, opts], + **taskOpts) +-- +2.46.0 + diff --git a/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch b/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch new file mode 100644 index 0000000..e25a670 --- /dev/null +++ b/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch @@ -0,0 +1,83 @@ +From 06840501bd7b52ee38a7a0c337cadfbf4512fc5d Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Sun, 11 Aug 2024 15:11:51 -0400 +Subject: [PATCH 2/2] kiwi: Add support for overriding kiwi image file name + format + +In order to be able to support workflows where the exact structure +of the image filenames matter (e.g. for Linux distribution artifacts), +support optionally overriding the image file name structure. +--- + plugins/builder/kiwi.py | 2 ++ + plugins/cli/kiwi.py | 3 +++ + plugins/hub/kiwi.py | 6 +++++- + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index 99737f7c..1b4a9481 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -408,6 +408,8 @@ class KiwiCreateImageTask(BaseBuildTask): + '--target-dir', target_dir, + '--bundle-dir', bundle_dir, + '--id', release] ++ if self.opts.get('result_bundle_name_format'): ++ cmd.extend(['--bundle-format', self.opts['result_bundle_name_format']]) + rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) + if rv: + raise koji.GenericError("Kiwi failed") +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 7e3e9771..f0172575 100644 +--- a/plugins/cli/kiwi.py ++++ b/plugins/cli/kiwi.py +@@ -31,6 +31,7 @@ def handle_kiwi_build(goptions, session, args): + parser.add_option("--type-attr", action="append", default=[], + help="Override default attributes for the build type from description. " + "May be used multiple times.") ++ 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("--can-fail", action="store", dest="optional_arches", +@@ -73,6 +74,8 @@ def handle_kiwi_build(goptions, session, args): + kwargs['type'] = options.type + if options.type_attr: + kwargs['type_attr'] = options.type_attr ++ if options.result_bundle_name_format: ++ kwargs['result_bundle_name_format'] = options.result_bundle_name_format + if options.arches: + kwargs['arches'] = [canonArch(arch) for arch in options.arches] + if options.repo: +diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py +index 852cbad1..15f352cc 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): ++ type=None, type_attr=None, result_bundle_name_format=None): + context.session.assertPerm('image') + for i in [desc_url, desc_path, profile, release]: + if i is not None: +@@ -26,6 +26,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile + kojihub.convert_value(repos, cast=list, check_only=True) + if type_attr: + kojihub.convert_value(type_attr, cast=list, check_only=True) ++ if result_bundle_name_format: ++ kojihub.convert_value(result_bundle_name_format, cast=str, check_only=True) + kojihub.get_build_target(target, strict=True) + if isinstance(arches, list): + arches = " ".join(arches) +@@ -62,6 +64,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile + opts['type'] = type + if type_attr: + opts['type_attr'] = type_attr ++ if result_bundle_name_format: ++ opts['result_bundle_name_format'] = result_bundle_name_format + return kojihub.make_task('kiwiBuild', + [target, arches, desc_url, desc_path, opts], + **taskOpts) +-- +2.46.0 + diff --git a/koji.spec b/koji.spec index d060c0a..66e6403 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.34.1 -Release: 3%{?dist} +Release: 4%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -30,6 +30,10 @@ Patch102: https://pagure.io/koji/pull-request/4013.patch Patch103: https://pagure.io/koji/pull-request/4026.patch # setup.py: Fix version retrieval on Python 3.13+ Patch104: https://pagure.io/koji/pull-request/4100.patch +# kiwi image name override support, upstream but not released yet +# https://pagure.io/koji/pull-request/4157 +Patch105: 0001-kiwi-Add-support-for-overriding-image-type-attribute.patch +Patch106: 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} @@ -362,6 +366,9 @@ done %systemd_postun kojira.service %changelog +* Thu Aug 22 2024 Adam Williamson - 1.34.1-4 +- Backport PR #4157 to support overriding Kiwi image file name format + * Thu Jul 18 2024 Fedora Release Engineering - 1.34.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From b912ffd10e21edb6c8757cd56ddd3ac375c63ede Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 22 Aug 2024 09:48:12 -0700 Subject: [PATCH 6/9] Backport PR #4181 to fix a typo in the image type override patch --- ...e-kiwi-image-type-attribute-override.patch | 29 +++++++++++++++++++ koji.spec | 3 ++ 2 files changed, 32 insertions(+) create mode 100644 0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch diff --git a/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch b/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch new file mode 100644 index 0000000..0312b01 --- /dev/null +++ b/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch @@ -0,0 +1,29 @@ +From 3e0b8103d26d4430de391635e699c0035bc39d36 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Thu, 22 Aug 2024 09:44:50 -0700 +Subject: [PATCH] Fix a typo in the kiwi image type attribute override patch + +This colon was duplicated, which is syntactically invalid and +prevents the file from loading at all. + +Signed-off-by: Adam Williamson +--- + plugins/builder/kiwi.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index 1b4a9481..369071ef 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -389,7 +389,7 @@ class KiwiCreateImageTask(BaseBuildTask): + '--description', os.path.join(os.path.basename(scmsrcdir), base_path), + '--target-dir', target_dir, + ]) +- for typeattr in self.opts.get('type_attr', []):: ++ for typeattr in self.opts.get('type_attr', []): + cmd.extend(['--set-type-attr', typeattr]) + rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) + if rv: +-- +2.46.0 + diff --git a/koji.spec b/koji.spec index 66e6403..f30b23e 100644 --- a/koji.spec +++ b/koji.spec @@ -34,6 +34,9 @@ Patch104: https://pagure.io/koji/pull-request/4100.patch # https://pagure.io/koji/pull-request/4157 Patch105: 0001-kiwi-Add-support-for-overriding-image-type-attribute.patch Patch106: 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch +# Fix a typo in the image-type-attribute patch +# https://pagure.io/koji/pull-request/4181 +Patch107: 0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} From fa7d0ee69f0d565d057d8efe0a3577a507db2abb Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 26 Aug 2024 14:27:36 -0700 Subject: [PATCH 7/9] Backport PRs 4063 and 4184 (more kiwi fixes) --- ...ildroot-repo-if-user-repositories-ar.patch | 39 +++++ ...-option-for-not-using-buildroot-repo.patch | 75 +++++++++ ...-Don-t-use-buildroot-repo-by-default.patch | 72 +++++++++ 0004-version-check-typo-fixes.patch | 53 +++++++ 0005-improve-warnings-for-older-hub.patch | 38 +++++ ...-for-overriding-version-and-releasev.patch | 146 ++++++++++++++++++ koji.spec | 15 +- 7 files changed, 437 insertions(+), 1 deletion(-) create mode 100644 0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch create mode 100644 0002-kiwi-option-for-not-using-buildroot-repo.patch create mode 100644 0003-Don-t-use-buildroot-repo-by-default.patch create mode 100644 0004-version-check-typo-fixes.patch create mode 100644 0005-improve-warnings-for-older-hub.patch create mode 100644 0006-kiwi-Add-support-for-overriding-version-and-releasev.patch diff --git a/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch b/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch new file mode 100644 index 0000000..913c5b4 --- /dev/null +++ b/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch @@ -0,0 +1,39 @@ +From 694ac4148301ef1efb69fbef0072190e1671a356 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 20 Mar 2024 12:45:17 -0400 +Subject: [PATCH 1/6] kiwi: Only add buildroot repo if user repositories are + not defined + +In general, we assume that if the user is specifying repositories, +the built-in one should not be used. +--- + plugins/builder/kiwi.py | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index 369071ef..d5d4fbdc 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -351,12 +351,13 @@ 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) ++ # buildroot repo if user repos not defined ++ if repos == []: ++ 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'): +-- +2.46.0 + diff --git a/0002-kiwi-option-for-not-using-buildroot-repo.patch b/0002-kiwi-option-for-not-using-buildroot-repo.patch new file mode 100644 index 0000000..8eca644 --- /dev/null +++ b/0002-kiwi-option-for-not-using-buildroot-repo.patch @@ -0,0 +1,75 @@ +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 + diff --git a/0003-Don-t-use-buildroot-repo-by-default.patch b/0003-Don-t-use-buildroot-repo-by-default.patch new file mode 100644 index 0000000..19b2588 --- /dev/null +++ b/0003-Don-t-use-buildroot-repo-by-default.patch @@ -0,0 +1,72 @@ +From dd594826f21a5b6b493ffd360745dc3b4af5c978 Mon Sep 17 00:00:00 2001 +From: Tomas Kopecek +Date: Thu, 9 May 2024 12:04:33 +0200 +Subject: [PATCH 3/6] Don't use buildroot repo by default + +--- + plugins/builder/kiwi.py | 2 +- + plugins/cli/kiwi.py | 12 ++++++------ + plugins/hub/kiwi.py | 4 ++-- + 3 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index a878ad56..2ac5cb3b 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -351,7 +351,7 @@ class KiwiCreateImageTask(BaseBuildTask): + + # user repos + repos = self.opts.get('repos', []) +- if self.opts.get('use_buildroot_repo', True): ++ 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) +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 6611df73..840e7539 100644 +--- a/plugins/cli/kiwi.py ++++ b/plugins/cli/kiwi.py +@@ -34,10 +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("--buildroot-repo", action="store_false", ++ dest="use_buildroot_repo", default=False, ++ help="Add buildroot repo to installation sources. This is off by default, " ++ "but uf 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 " +@@ -84,8 +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 ++ if options.use_buildroot_repo or not options.repo: ++ kwargs['use_buildroot_repo'] = True + + task_id = session.kiwiBuild(**kwargs) + +diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py +index cd03ab42..81852e52 100644 +--- a/plugins/hub/kiwi.py ++++ b/plugins/hub/kiwi.py +@@ -62,8 +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 use_buildroot_repo: ++ opts['use_buildroot_repo'] = True + if type_attr: + opts['type_attr'] = type_attr + if result_bundle_name_format: +-- +2.46.0 + diff --git a/0004-version-check-typo-fixes.patch b/0004-version-check-typo-fixes.patch new file mode 100644 index 0000000..75db4a4 --- /dev/null +++ b/0004-version-check-typo-fixes.patch @@ -0,0 +1,53 @@ +From 810836944ad9aaf28c935e14db4405b96201ed55 Mon Sep 17 00:00:00 2001 +From: Tomas Kopecek +Date: Mon, 13 May 2024 11:02:53 +0200 +Subject: [PATCH 4/6] version check + typo fixes + +--- + plugins/cli/kiwi.py | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 840e7539..8f8addaf 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,10 +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_false", ++ 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 uf there is no --repo used, it will be turned on automatically.") ++ "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 " +@@ -85,7 +86,14 @@ def handle_kiwi_build(goptions, session, args): + if options.repo: + kwargs['repos'] = options.repo + if options.use_buildroot_repo or not options.repo: +- kwargs['use_buildroot_repo'] = True ++ if not options.repo: ++ warn("no repos given, using buildroot repo") ++ if session.hub_version >= (1, 35, 0): ++ # for older plugin versions it is the default behaviour ++ # and option doesn't exist ++ kwargs['use_buildroot_repo'] = True ++ if session.hub_version < (1, 35, 0): ++ warn("hub version is < 1.35, buildroot repo is always used in addition to specified repos") + + task_id = session.kiwiBuild(**kwargs) + +-- +2.46.0 + diff --git a/0005-improve-warnings-for-older-hub.patch b/0005-improve-warnings-for-older-hub.patch new file mode 100644 index 0000000..676a909 --- /dev/null +++ b/0005-improve-warnings-for-older-hub.patch @@ -0,0 +1,38 @@ +From 0e43634af51842f92da3911899d0d10f4b544a51 Mon Sep 17 00:00:00 2001 +From: Tomas Kopecek +Date: Wed, 15 May 2024 09:26:36 +0200 +Subject: [PATCH 5/6] improve warnings for older hub + +--- + plugins/cli/kiwi.py | 13 ++++++------- + 1 file changed, 6 insertions(+), 7 deletions(-) + +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 8f8addaf..02958373 100644 +--- a/plugins/cli/kiwi.py ++++ b/plugins/cli/kiwi.py +@@ -85,15 +85,14 @@ def handle_kiwi_build(goptions, session, args): + kwargs['arches'] = [canonArch(arch) for arch in options.arches] + if options.repo: + kwargs['repos'] = options.repo +- if options.use_buildroot_repo or not options.repo: +- if not options.repo: +- warn("no repos given, using buildroot repo") +- if session.hub_version >= (1, 35, 0): +- # for older plugin versions it is the default behaviour +- # and option doesn't exist +- kwargs['use_buildroot_repo'] = True ++ + 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) + +-- +2.46.0 + diff --git a/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch b/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch new file mode 100644 index 0000000..9dc767f --- /dev/null +++ b/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch @@ -0,0 +1,146 @@ +From a5dd7950434e4ff8dc37d77803f23dcb480aaa4b Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Mon, 26 Aug 2024 10:02:43 -0400 +Subject: [PATCH 6/6] kiwi: Add support for overriding version and releasever + +This allows for kiwi descriptions that are compatible across +multiple targets to be easily used without needless modifications. + +Additionally, it allows for custom values when preparing milestone +releases without needlessly modifying the descriptions. +--- + plugins/builder/kiwi.py | 15 +++++++++++---- + plugins/cli/kiwi.py | 6 ++++++ + plugins/hub/kiwi.py | 9 +++++++-- + 3 files changed, 24 insertions(+), 6 deletions(-) + +diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py +index 2ac5cb3b..f222dec1 100644 +--- a/plugins/builder/kiwi.py ++++ b/plugins/builder/kiwi.py +@@ -103,6 +103,8 @@ class KiwiBuildTask(BuildImageTask): + name = "%s-%s" % (name, opts.get('profile', default_profile)) + + bld_info = {} ++ if opts.get('version'): ++ version = opts['version'] + if opts.get('release'): + release = opts['release'] + else: +@@ -188,7 +190,7 @@ class KiwiCreateImageTask(BaseBuildTask): + Methods = ['createKiwiImage'] + _taskWeight = 2.0 + +- def prepareDescription(self, desc_path, name, version, repos, arch): ++ def prepareDescription(self, desc_path, name, version, repos, repo_releasever, arch): + # XML errors should have already been caught by parent task + newxml = xml.dom.minidom.parse(desc_path) # nosec + image = newxml.getElementsByTagName('image')[0] +@@ -229,11 +231,15 @@ class KiwiCreateImageTask(BaseBuildTask): + + image.setAttribute('name', name) + preferences = image.getElementsByTagName('preferences')[0] ++ ++ # Handle version and release-version ++ preferences.getElementsByTagName('version')[0].childNodes[0].data = version + try: +- preferences.getElementsByTagName('release-version')[0].childNodes[0].data = version ++ preferences.getElementsByTagName('release-version')[0].childNodes[0].data \ ++ = repo_releasever + except IndexError: + releasever_node = newxml.createElement('release-version') +- text = newxml.createTextNode(version) ++ text = newxml.createTextNode(repo_releasever) + releasever_node.appendChild(text) + preferences.appendChild(releasever_node) + +@@ -357,6 +363,7 @@ class KiwiCreateImageTask(BaseBuildTask): + baseurl = '%s/%s' % (repopath, arch) + self.logger.debug('BASEURL: %s' % baseurl) + repos.append(baseurl) ++ repo_releasever = self.opts.get('repo_releasever', version) + + base_path = os.path.dirname(desc_path) + if opts.get('make_prep'): +@@ -368,7 +375,7 @@ class KiwiCreateImageTask(BaseBuildTask): + raise koji.GenericError("Preparation step failed") + + path = os.path.join(scmsrcdir, desc_path) +- desc, types = self.prepareDescription(path, name, version, repos, arch) ++ desc, types = self.prepareDescription(path, name, version, repos, repo_releasever, arch) + self.uploadFile(desc) + + target_dir = '/builddir/result/image' +diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py +index 02958373..9d177ac9 100644 +--- a/plugins/cli/kiwi.py ++++ b/plugins/cli/kiwi.py +@@ -19,11 +19,13 @@ def handle_kiwi_build(goptions, session, args): + parser = OptionParser(usage=usage) + parser.add_option("--scratch", action="store_true", default=False, + help="Perform a scratch build") ++ parser.add_option("--version", help="Override default version of the output image") + parser.add_option("--release", help="Release of the output image") + parser.add_option("--repo", action="append", + help="Specify a repo that will override the repo used to install " + "RPMs in the image. May be used multiple times. The " + "build tag repo associated with the target is the default.") ++ parser.add_option("--repo-releasever", help="Override default releasever of the output image") + parser.add_option("--noprogress", action="store_true", + help="Do not display progress of the upload") + parser.add_option("--kiwi-profile", action="store", default=None, +@@ -71,6 +73,8 @@ def handle_kiwi_build(goptions, session, args): + if arch] + if options.kiwi_profile: + kwargs['profile'] = options.kiwi_profile ++ if options.version: ++ kwargs['version'] = options.version + if options.release: + kwargs['release'] = options.release + if options.make_prep: +@@ -85,6 +89,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 options.repo_releasever: ++ kwargs['repo_releasever'] = options.repo_releasever + + if session.hub_version < (1, 35, 0): + warn("hub version is < 1.35, buildroot repo is always used in addition to specified repos") +diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py +index 81852e52..4aeb1048 100644 +--- a/plugins/hub/kiwi.py ++++ b/plugins/hub/kiwi.py +@@ -17,9 +17,10 @@ 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, use_buildroot_repo=True): ++ type=None, type_attr=None, result_bundle_name_format=None, use_buildroot_repo=True, ++ version=None, repo_releasever=None): + context.session.assertPerm('image') +- for i in [desc_url, desc_path, profile, release]: ++ for i in [desc_url, desc_path, profile, version, release, repo_releasever]: + if i is not None: + kojihub.convert_value(i, cast=str, check_only=True) + if repos: +@@ -52,12 +53,16 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile + opts['scratch'] = True + if profile: + opts['profile'] = profile ++ if version: ++ opts['version'] = version + if release: + opts['release'] = release + if optional_arches: + opts['optional_arches'] = optional_arches + if repos: + opts['repos'] = repos ++ if repo_releasever: ++ opts['repo_releasever'] = repo_releasever + if make_prep: + opts['make_prep'] = True + if type: +-- +2.46.0 + diff --git a/koji.spec b/koji.spec index f30b23e..577e3aa 100644 --- a/koji.spec +++ b/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.34.1 -Release: 4%{?dist} +Release: 5%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -37,6 +37,16 @@ Patch106: 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch # Fix a typo in the image-type-attribute patch # https://pagure.io/koji/pull-request/4181 Patch107: 0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch +# kiwi: only add buildroot repo if user repositories are not defined +# https://pagure.io/koji/pull-request/4063 +Patch108: 0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch +Patch109: 0002-kiwi-option-for-not-using-buildroot-repo.patch +Patch110: 0003-Don-t-use-buildroot-repo-by-default.patch +Patch111: 0004-version-check-typo-fixes.patch +Patch112: 0005-improve-warnings-for-older-hub.patch +# Allow overriding version and releasever for kiwi +# https://pagure.io/koji/pull-request/4184 +Patch113: 0006-kiwi-Add-support-for-overriding-version-and-releasev.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} @@ -369,6 +379,9 @@ done %systemd_postun kojira.service %changelog +* Mon Aug 26 2024 Adam Williamson - 1.34.1-5 +- Backport PR #4184 to support overriding version and releasever for Kiwi + * Thu Aug 22 2024 Adam Williamson - 1.34.1-4 - Backport PR #4157 to support overriding Kiwi image file name format From 1fa1abdca0722e13b07520ba5481e8691443f0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 2 Sep 2024 09:24:18 +0200 Subject: [PATCH 8/9] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- koji.spec | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/koji.spec b/koji.spec index 577e3aa..9ea11e5 100644 --- a/koji.spec +++ b/koji.spec @@ -9,9 +9,10 @@ Name: koji Version: 1.34.1 -Release: 5%{?dist} +Release: 6%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ -License: LGPLv2 and GPLv2+ +# Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-or-later Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 @@ -81,7 +82,8 @@ This subpackage provides python functions and libraries. %package -n python%{python3_pkgversion}-%{name}-cli-plugins Summary: Koji client plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} %description -n python%{python3_pkgversion}-%{name}-cli-plugins @@ -89,7 +91,8 @@ Plugins to the koji command-line interface %package hub Summary: Koji XMLRPC interface -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-hub-code %if 0%{?fedora} || 0%{?rhel} > 7 @@ -102,7 +105,8 @@ koji-hub is the XMLRPC interface to the koji database %package -n python%{python3_pkgversion}-%{name}-hub Summary: Koji XMLRPC interface -License: LGPLv2 and GPLv2 +# Automatically converted from old format: LGPLv2 and GPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-only # rpmdiff lib (from rpmlint) is GPLv2 (only) Requires: httpd Requires: python%{python3_pkgversion}-mod_wsgi @@ -116,7 +120,8 @@ koji-hub is the XMLRPC interface to the koji database %package hub-plugins Summary: Koji hub plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name}-hub-plugins-code = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} > 7 Suggests: python%{python3_pkgversion}-%{name}-hub-plugins @@ -127,7 +132,8 @@ Plugins to the koji XMLRPC interface %package -n python%{python3_pkgversion}-%{name}-hub-plugins Summary: Koji hub plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: python%{python3_pkgversion}-%{name}-hub = %{version}-%{release} Requires: python%{python3_pkgversion}-qpid-proton Requires: cpio @@ -138,7 +144,8 @@ Plugins to the koji XMLRPC interface %package builder-plugins Summary: Koji builder plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-builder = %{version}-%{release} @@ -147,7 +154,8 @@ Plugins for the koji build daemon %package builder Summary: Koji RPM builder daemon -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: mock >= 0.9.14 Requires(pre): /usr/sbin/useradd Requires: squashfs-tools @@ -170,7 +178,8 @@ tasks that come through the Koji system. %package vm Summary: Koji virtual machine management daemon -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires(post): systemd Requires(preun): systemd @@ -186,7 +195,8 @@ virtual machine. This package is not required for most installations. %package utils Summary: Koji Utilities -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: python%{python3_pkgversion}-psycopg2 Requires(post): systemd @@ -198,7 +208,8 @@ Utilities for the Koji system %package web Summary: Koji Web UI -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-web-code = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} > 7 @@ -210,7 +221,8 @@ koji-web is a web UI to the Koji system. %package -n python%{python3_pkgversion}-%{name}-web Summary: Koji Web UI -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 %{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-web} Requires: httpd Requires: python%{python3_pkgversion}-mod_wsgi @@ -379,6 +391,9 @@ done %systemd_postun kojira.service %changelog +* Mon Sep 02 2024 Miroslav Suchý - 1.34.1-6 +- convert license to SPDX + * Mon Aug 26 2024 Adam Williamson - 1.34.1-5 - Backport PR #4184 to support overriding version and releasever for Kiwi From 4b0c627b7c555c568418f23fac731902d34e9c94 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Wed, 18 Sep 2024 16:21:06 -0700 Subject: [PATCH 9/9] Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 Update to 1.35.0. Fixes rhbz#2312848 --- .gitignore | 1 + ...e-kiwi-image-type-attribute-override.patch | 29 --- ...-for-overriding-image-type-attribute.patch | 82 ------- ...ildroot-repo-if-user-repositories-ar.patch | 39 --- ...-for-overriding-kiwi-image-file-name.patch | 83 ------- ...-option-for-not-using-buildroot-repo.patch | 75 ------ ...-Don-t-use-buildroot-repo-by-default.patch | 72 ------ 0004-version-check-typo-fixes.patch | 53 ---- 0005-improve-warnings-for-older-hub.patch | 38 --- ...-for-overriding-version-and-releasev.patch | 146 ----------- ...961929a45ccae1d635b7e85a9d8826baf72d.patch | 29 --- ...5927aeb3e3c052fc9208ca71133d9d097fc0.patch | 229 ------------------ ...18fa356f1aa2a1b5099e55e0af1c89ae4163.patch | 26 -- 3974.patch | 43 ---- 4013.patch | 52 ---- 4026.patch | 38 --- 4100.patch | 33 --- koji.spec | 36 +-- sources | 2 +- 19 files changed, 7 insertions(+), 1099 deletions(-) delete mode 100644 0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch delete mode 100644 0001-kiwi-Add-support-for-overriding-image-type-attribute.patch delete mode 100644 0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch delete mode 100644 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch delete mode 100644 0002-kiwi-option-for-not-using-buildroot-repo.patch delete mode 100644 0003-Don-t-use-buildroot-repo-by-default.patch delete mode 100644 0004-version-check-typo-fixes.patch delete mode 100644 0005-improve-warnings-for-older-hub.patch delete mode 100644 0006-kiwi-Add-support-for-overriding-version-and-releasev.patch delete mode 100644 0251961929a45ccae1d635b7e85a9d8826baf72d.patch delete mode 100644 1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch delete mode 100644 2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch delete mode 100644 3974.patch delete mode 100644 4013.patch delete mode 100644 4026.patch delete mode 100644 4100.patch diff --git a/.gitignore b/.gitignore index 5f0e2ed..af3c4dd 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ koji-1.4.0.tar.bz2 /koji-1.33.1.tar.bz2 /koji-1.34.0.tar.bz2 /koji-1.34.1.tar.bz2 +/koji-1.35.0.tar.bz2 diff --git a/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch b/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch deleted file mode 100644 index 0312b01..0000000 --- a/0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 3e0b8103d26d4430de391635e699c0035bc39d36 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Thu, 22 Aug 2024 09:44:50 -0700 -Subject: [PATCH] Fix a typo in the kiwi image type attribute override patch - -This colon was duplicated, which is syntactically invalid and -prevents the file from loading at all. - -Signed-off-by: Adam Williamson ---- - plugins/builder/kiwi.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 1b4a9481..369071ef 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -389,7 +389,7 @@ class KiwiCreateImageTask(BaseBuildTask): - '--description', os.path.join(os.path.basename(scmsrcdir), base_path), - '--target-dir', target_dir, - ]) -- for typeattr in self.opts.get('type_attr', []):: -+ for typeattr in self.opts.get('type_attr', []): - cmd.extend(['--set-type-attr', typeattr]) - rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) - if rv: --- -2.46.0 - diff --git a/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch b/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch deleted file mode 100644 index f31ad5c..0000000 --- a/0001-kiwi-Add-support-for-overriding-image-type-attribute.patch +++ /dev/null @@ -1,82 +0,0 @@ -From b22449c553b344fd3a1ee7cb49c769754ddfa347 Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Sun, 11 Aug 2024 14:42:31 -0400 -Subject: [PATCH 1/2] kiwi: Add support for overriding image type attributes - -This allows setting things like the volume and application IDs -for ISO builds. ---- - plugins/builder/kiwi.py | 2 ++ - plugins/cli/kiwi.py | 5 +++++ - plugins/hub/kiwi.py | 6 +++++- - 3 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index a9d63cf0..99737f7c 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -389,6 +389,8 @@ class KiwiCreateImageTask(BaseBuildTask): - '--description', os.path.join(os.path.basename(scmsrcdir), base_path), - '--target-dir', target_dir, - ]) -+ for typeattr in self.opts.get('type_attr', []):: -+ cmd.extend(['--set-type-attr', typeattr]) - rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) - if rv: - raise koji.GenericError("Kiwi failed") -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 6e965c05..7e3e9771 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -28,6 +28,9 @@ def handle_kiwi_build(goptions, session, args): - 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("--type-attr", action="append", default=[], -+ help="Override default attributes for the build type from description. " -+ "May be used multiple times.") - 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", -@@ -68,6 +71,8 @@ def handle_kiwi_build(goptions, session, args): - kwargs['make_prep'] = True - if options.type: - kwargs['type'] = options.type -+ if options.type_attr: -+ kwargs['type_attr'] = options.type_attr - if options.arches: - kwargs['arches'] = [canonArch(arch) for arch in options.arches] - if options.repo: -diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py -index 7b0c2f05..852cbad1 100644 ---- a/plugins/hub/kiwi.py -+++ b/plugins/hub/kiwi.py -@@ -17,13 +17,15 @@ 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=None, type_attr=None): - context.session.assertPerm('image') - for i in [desc_url, desc_path, profile, release]: - if i is not None: - kojihub.convert_value(i, cast=str, check_only=True) - if repos: - kojihub.convert_value(repos, cast=list, check_only=True) -+ if type_attr: -+ kojihub.convert_value(type_attr, cast=list, check_only=True) - kojihub.get_build_target(target, strict=True) - if isinstance(arches, list): - arches = " ".join(arches) -@@ -58,6 +60,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile - opts['make_prep'] = True - if type: - opts['type'] = type -+ if type_attr: -+ opts['type_attr'] = type_attr - return kojihub.make_task('kiwiBuild', - [target, arches, desc_url, desc_path, opts], - **taskOpts) --- -2.46.0 - diff --git a/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch b/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch deleted file mode 100644 index 913c5b4..0000000 --- a/0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 694ac4148301ef1efb69fbef0072190e1671a356 Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Wed, 20 Mar 2024 12:45:17 -0400 -Subject: [PATCH 1/6] kiwi: Only add buildroot repo if user repositories are - not defined - -In general, we assume that if the user is specifying repositories, -the built-in one should not be used. ---- - plugins/builder/kiwi.py | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 369071ef..d5d4fbdc 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -351,12 +351,13 @@ 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) -+ # buildroot repo if user repos not defined -+ if repos == []: -+ 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'): --- -2.46.0 - diff --git a/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch b/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch deleted file mode 100644 index e25a670..0000000 --- a/0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 06840501bd7b52ee38a7a0c337cadfbf4512fc5d Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Sun, 11 Aug 2024 15:11:51 -0400 -Subject: [PATCH 2/2] kiwi: Add support for overriding kiwi image file name - format - -In order to be able to support workflows where the exact structure -of the image filenames matter (e.g. for Linux distribution artifacts), -support optionally overriding the image file name structure. ---- - plugins/builder/kiwi.py | 2 ++ - plugins/cli/kiwi.py | 3 +++ - plugins/hub/kiwi.py | 6 +++++- - 3 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 99737f7c..1b4a9481 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -408,6 +408,8 @@ class KiwiCreateImageTask(BaseBuildTask): - '--target-dir', target_dir, - '--bundle-dir', bundle_dir, - '--id', release] -+ if self.opts.get('result_bundle_name_format'): -+ cmd.extend(['--bundle-format', self.opts['result_bundle_name_format']]) - rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd) - if rv: - raise koji.GenericError("Kiwi failed") -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 7e3e9771..f0172575 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -31,6 +31,7 @@ def handle_kiwi_build(goptions, session, args): - parser.add_option("--type-attr", action="append", default=[], - help="Override default attributes for the build type from description. " - "May be used multiple times.") -+ 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("--can-fail", action="store", dest="optional_arches", -@@ -73,6 +74,8 @@ def handle_kiwi_build(goptions, session, args): - kwargs['type'] = options.type - if options.type_attr: - kwargs['type_attr'] = options.type_attr -+ if options.result_bundle_name_format: -+ kwargs['result_bundle_name_format'] = options.result_bundle_name_format - if options.arches: - kwargs['arches'] = [canonArch(arch) for arch in options.arches] - if options.repo: -diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py -index 852cbad1..15f352cc 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): -+ type=None, type_attr=None, result_bundle_name_format=None): - context.session.assertPerm('image') - for i in [desc_url, desc_path, profile, release]: - if i is not None: -@@ -26,6 +26,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile - kojihub.convert_value(repos, cast=list, check_only=True) - if type_attr: - kojihub.convert_value(type_attr, cast=list, check_only=True) -+ if result_bundle_name_format: -+ kojihub.convert_value(result_bundle_name_format, cast=str, check_only=True) - kojihub.get_build_target(target, strict=True) - if isinstance(arches, list): - arches = " ".join(arches) -@@ -62,6 +64,8 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile - opts['type'] = type - if type_attr: - opts['type_attr'] = type_attr -+ if result_bundle_name_format: -+ opts['result_bundle_name_format'] = result_bundle_name_format - return kojihub.make_task('kiwiBuild', - [target, arches, desc_url, desc_path, opts], - **taskOpts) --- -2.46.0 - diff --git a/0002-kiwi-option-for-not-using-buildroot-repo.patch b/0002-kiwi-option-for-not-using-buildroot-repo.patch deleted file mode 100644 index 8eca644..0000000 --- a/0002-kiwi-option-for-not-using-buildroot-repo.patch +++ /dev/null @@ -1,75 +0,0 @@ -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 - diff --git a/0003-Don-t-use-buildroot-repo-by-default.patch b/0003-Don-t-use-buildroot-repo-by-default.patch deleted file mode 100644 index 19b2588..0000000 --- a/0003-Don-t-use-buildroot-repo-by-default.patch +++ /dev/null @@ -1,72 +0,0 @@ -From dd594826f21a5b6b493ffd360745dc3b4af5c978 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Thu, 9 May 2024 12:04:33 +0200 -Subject: [PATCH 3/6] Don't use buildroot repo by default - ---- - plugins/builder/kiwi.py | 2 +- - plugins/cli/kiwi.py | 12 ++++++------ - plugins/hub/kiwi.py | 4 ++-- - 3 files changed, 9 insertions(+), 9 deletions(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index a878ad56..2ac5cb3b 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -351,7 +351,7 @@ class KiwiCreateImageTask(BaseBuildTask): - - # user repos - repos = self.opts.get('repos', []) -- if self.opts.get('use_buildroot_repo', True): -+ 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) -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 6611df73..840e7539 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -34,10 +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("--buildroot-repo", action="store_false", -+ dest="use_buildroot_repo", default=False, -+ help="Add buildroot repo to installation sources. This is off by default, " -+ "but uf 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 " -@@ -84,8 +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 -+ if options.use_buildroot_repo or not options.repo: -+ kwargs['use_buildroot_repo'] = True - - task_id = session.kiwiBuild(**kwargs) - -diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py -index cd03ab42..81852e52 100644 ---- a/plugins/hub/kiwi.py -+++ b/plugins/hub/kiwi.py -@@ -62,8 +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 use_buildroot_repo: -+ opts['use_buildroot_repo'] = True - if type_attr: - opts['type_attr'] = type_attr - if result_bundle_name_format: --- -2.46.0 - diff --git a/0004-version-check-typo-fixes.patch b/0004-version-check-typo-fixes.patch deleted file mode 100644 index 75db4a4..0000000 --- a/0004-version-check-typo-fixes.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 810836944ad9aaf28c935e14db4405b96201ed55 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Mon, 13 May 2024 11:02:53 +0200 -Subject: [PATCH 4/6] version check + typo fixes - ---- - plugins/cli/kiwi.py | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 840e7539..8f8addaf 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,10 +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_false", -+ 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 uf there is no --repo used, it will be turned on automatically.") -+ "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 " -@@ -85,7 +86,14 @@ def handle_kiwi_build(goptions, session, args): - if options.repo: - kwargs['repos'] = options.repo - if options.use_buildroot_repo or not options.repo: -- kwargs['use_buildroot_repo'] = True -+ if not options.repo: -+ warn("no repos given, using buildroot repo") -+ if session.hub_version >= (1, 35, 0): -+ # for older plugin versions it is the default behaviour -+ # and option doesn't exist -+ kwargs['use_buildroot_repo'] = True -+ if session.hub_version < (1, 35, 0): -+ warn("hub version is < 1.35, buildroot repo is always used in addition to specified repos") - - task_id = session.kiwiBuild(**kwargs) - --- -2.46.0 - diff --git a/0005-improve-warnings-for-older-hub.patch b/0005-improve-warnings-for-older-hub.patch deleted file mode 100644 index 676a909..0000000 --- a/0005-improve-warnings-for-older-hub.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0e43634af51842f92da3911899d0d10f4b544a51 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Wed, 15 May 2024 09:26:36 +0200 -Subject: [PATCH 5/6] improve warnings for older hub - ---- - plugins/cli/kiwi.py | 13 ++++++------- - 1 file changed, 6 insertions(+), 7 deletions(-) - -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 8f8addaf..02958373 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -85,15 +85,14 @@ def handle_kiwi_build(goptions, session, args): - kwargs['arches'] = [canonArch(arch) for arch in options.arches] - if options.repo: - kwargs['repos'] = options.repo -- if options.use_buildroot_repo or not options.repo: -- if not options.repo: -- warn("no repos given, using buildroot repo") -- if session.hub_version >= (1, 35, 0): -- # for older plugin versions it is the default behaviour -- # and option doesn't exist -- kwargs['use_buildroot_repo'] = True -+ - 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) - --- -2.46.0 - diff --git a/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch b/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch deleted file mode 100644 index 9dc767f..0000000 --- a/0006-kiwi-Add-support-for-overriding-version-and-releasev.patch +++ /dev/null @@ -1,146 +0,0 @@ -From a5dd7950434e4ff8dc37d77803f23dcb480aaa4b Mon Sep 17 00:00:00 2001 -From: Neal Gompa -Date: Mon, 26 Aug 2024 10:02:43 -0400 -Subject: [PATCH 6/6] kiwi: Add support for overriding version and releasever - -This allows for kiwi descriptions that are compatible across -multiple targets to be easily used without needless modifications. - -Additionally, it allows for custom values when preparing milestone -releases without needlessly modifying the descriptions. ---- - plugins/builder/kiwi.py | 15 +++++++++++---- - plugins/cli/kiwi.py | 6 ++++++ - plugins/hub/kiwi.py | 9 +++++++-- - 3 files changed, 24 insertions(+), 6 deletions(-) - -diff --git a/plugins/builder/kiwi.py b/plugins/builder/kiwi.py -index 2ac5cb3b..f222dec1 100644 ---- a/plugins/builder/kiwi.py -+++ b/plugins/builder/kiwi.py -@@ -103,6 +103,8 @@ class KiwiBuildTask(BuildImageTask): - name = "%s-%s" % (name, opts.get('profile', default_profile)) - - bld_info = {} -+ if opts.get('version'): -+ version = opts['version'] - if opts.get('release'): - release = opts['release'] - else: -@@ -188,7 +190,7 @@ class KiwiCreateImageTask(BaseBuildTask): - Methods = ['createKiwiImage'] - _taskWeight = 2.0 - -- def prepareDescription(self, desc_path, name, version, repos, arch): -+ def prepareDescription(self, desc_path, name, version, repos, repo_releasever, arch): - # XML errors should have already been caught by parent task - newxml = xml.dom.minidom.parse(desc_path) # nosec - image = newxml.getElementsByTagName('image')[0] -@@ -229,11 +231,15 @@ class KiwiCreateImageTask(BaseBuildTask): - - image.setAttribute('name', name) - preferences = image.getElementsByTagName('preferences')[0] -+ -+ # Handle version and release-version -+ preferences.getElementsByTagName('version')[0].childNodes[0].data = version - try: -- preferences.getElementsByTagName('release-version')[0].childNodes[0].data = version -+ preferences.getElementsByTagName('release-version')[0].childNodes[0].data \ -+ = repo_releasever - except IndexError: - releasever_node = newxml.createElement('release-version') -- text = newxml.createTextNode(version) -+ text = newxml.createTextNode(repo_releasever) - releasever_node.appendChild(text) - preferences.appendChild(releasever_node) - -@@ -357,6 +363,7 @@ class KiwiCreateImageTask(BaseBuildTask): - baseurl = '%s/%s' % (repopath, arch) - self.logger.debug('BASEURL: %s' % baseurl) - repos.append(baseurl) -+ repo_releasever = self.opts.get('repo_releasever', version) - - base_path = os.path.dirname(desc_path) - if opts.get('make_prep'): -@@ -368,7 +375,7 @@ class KiwiCreateImageTask(BaseBuildTask): - raise koji.GenericError("Preparation step failed") - - path = os.path.join(scmsrcdir, desc_path) -- desc, types = self.prepareDescription(path, name, version, repos, arch) -+ desc, types = self.prepareDescription(path, name, version, repos, repo_releasever, arch) - self.uploadFile(desc) - - target_dir = '/builddir/result/image' -diff --git a/plugins/cli/kiwi.py b/plugins/cli/kiwi.py -index 02958373..9d177ac9 100644 ---- a/plugins/cli/kiwi.py -+++ b/plugins/cli/kiwi.py -@@ -19,11 +19,13 @@ def handle_kiwi_build(goptions, session, args): - parser = OptionParser(usage=usage) - parser.add_option("--scratch", action="store_true", default=False, - help="Perform a scratch build") -+ parser.add_option("--version", help="Override default version of the output image") - parser.add_option("--release", help="Release of the output image") - parser.add_option("--repo", action="append", - help="Specify a repo that will override the repo used to install " - "RPMs in the image. May be used multiple times. The " - "build tag repo associated with the target is the default.") -+ parser.add_option("--repo-releasever", help="Override default releasever of the output image") - parser.add_option("--noprogress", action="store_true", - help="Do not display progress of the upload") - parser.add_option("--kiwi-profile", action="store", default=None, -@@ -71,6 +73,8 @@ def handle_kiwi_build(goptions, session, args): - if arch] - if options.kiwi_profile: - kwargs['profile'] = options.kiwi_profile -+ if options.version: -+ kwargs['version'] = options.version - if options.release: - kwargs['release'] = options.release - if options.make_prep: -@@ -85,6 +89,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 options.repo_releasever: -+ kwargs['repo_releasever'] = options.repo_releasever - - if session.hub_version < (1, 35, 0): - warn("hub version is < 1.35, buildroot repo is always used in addition to specified repos") -diff --git a/plugins/hub/kiwi.py b/plugins/hub/kiwi.py -index 81852e52..4aeb1048 100644 ---- a/plugins/hub/kiwi.py -+++ b/plugins/hub/kiwi.py -@@ -17,9 +17,10 @@ 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, use_buildroot_repo=True): -+ type=None, type_attr=None, result_bundle_name_format=None, use_buildroot_repo=True, -+ version=None, repo_releasever=None): - context.session.assertPerm('image') -- for i in [desc_url, desc_path, profile, release]: -+ for i in [desc_url, desc_path, profile, version, release, repo_releasever]: - if i is not None: - kojihub.convert_value(i, cast=str, check_only=True) - if repos: -@@ -52,12 +53,16 @@ def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile - opts['scratch'] = True - if profile: - opts['profile'] = profile -+ if version: -+ opts['version'] = version - if release: - opts['release'] = release - if optional_arches: - opts['optional_arches'] = optional_arches - if repos: - opts['repos'] = repos -+ if repo_releasever: -+ opts['repo_releasever'] = repo_releasever - if make_prep: - opts['make_prep'] = True - if type: --- -2.46.0 - diff --git a/0251961929a45ccae1d635b7e85a9d8826baf72d.patch b/0251961929a45ccae1d635b7e85a9d8826baf72d.patch deleted file mode 100644 index c910262..0000000 --- a/0251961929a45ccae1d635b7e85a9d8826baf72d.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0251961929a45ccae1d635b7e85a9d8826baf72d Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Feb 07 2024 13:45:08 +0000 -Subject: PR#3989: Oz: don't hardcode the image size unit as 'G' - - -Merges #3989 -https://pagure.io/koji/pull-request/3989 - -Fixes: #3993 -https://pagure.io/koji/issue/3993 - Oz: don't hardcode the image size unit as 'G' - ---- - -diff --git a/builder/kojid b/builder/kojid -index fe35e47..b4536dd 100755 ---- a/builder/kojid -+++ b/builder/kojid -@@ -4101,7 +4101,7 @@ class OzImageTask(BaseTaskHandler): - template += """ - %s OS - -- %sG -+ %s - - - """ % (name, self.opts.get('disk_size')) # noqa: E501 - diff --git a/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch b/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch deleted file mode 100644 index 9be3dcc..0000000 --- a/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch +++ /dev/null @@ -1,229 +0,0 @@ -From 1d515927aeb3e3c052fc9208ca71133d9d097fc0 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Thu, 13 Apr 2023 11:12:40 +0200 -Subject: [PATCH] scmpolicy plugin - ---- - docs/source/defining_hub_policies.rst | 10 +++- - docs/source/plugins.rst | 30 ++++++++++- - koji/policy.py | 53 +++++++++++++++++++- - plugins/builder/scmpolicy.py | 72 +++++++++++++++++++++++++++ - 4 files changed, 162 insertions(+), 3 deletions(-) - create mode 100644 plugins/builder/scmpolicy.py - -diff --git a/docs/source/defining_hub_policies.rst b/docs/source/defining_hub_policies.rst -index a0b67eed..8f9cf2cd 100644 ---- a/docs/source/defining_hub_policies.rst -+++ b/docs/source/defining_hub_policies.rst -@@ -341,5 +341,13 @@ Available tests - * the user matched is the user performing the action - - ``match`` -- * matches a field in the data against glob patterns -+ * matches a field in the data against glob patterns - * true if any pattern matches -+ -+``match_any`` -+ * matches a field (of list/tuple/set type) in the data against glob patterns -+ * true if any field item matches all patterns -+ -+``match_all`` -+ * matches a field (of list/tuple/set type) in the data against glob patterns -+ * true if all field items match any pattern -diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst -index c370709a..d5b2d13f 100644 ---- a/docs/source/plugins.rst -+++ b/docs/source/plugins.rst -@@ -223,7 +223,7 @@ The ``[message]`` section sets parameters for how messages are formed. - Currently only one field is understood: - - * ``extra_limit`` -- the maximum allowed size for ``build.extra`` fields that -- appear in messages. If the ``build.extra`` field is longer (in terms of -+ appear in messages. If the ``build.extra`` field is longer (in terms of - json-encoded length), then it will be omitted. The default value is ``0`` - which means no limit. - -@@ -441,3 +441,31 @@ For example: - For each RPM in the tag, Koji will use the first signed copy that it finds. In other words, - Koji will try the first key (`45719a39`), and if Koji does not have the first key's signature - for that RPM, then it will try the second key (`9867c58f`), third key (`38ab71f4`), and so on. -+ -+Scm Policies -+============ -+ -+Basic filtering of allowed scms normally happens via standard -+``build_from_scm`` hub policy. Nevertheless, some relevant information can be -+only gathered after cloning the repo. Typical case is that admin would like to -+build content only from some set of allowed branches. If user specify the -+commit via hash, we don't have that information in moment of task creation. -+Just after cloning we can check existing branches and if the given commit is on -+some of the relevant ones. For this purpose there is special -+``postSCMCheckout`` plugin ``scmpolicy``. -+ -+Installation happens only on builder via editing ``/etc/kojid.conf`` by adding -+``plugin = scmpolicy`` there. Plugin itself is not configured but uses hub -+policy ``scm``. Policy data provided there are composed of two parts. First one -+are ``scm_*`` values which are same as in ``build_from_scm``. -+ -+.. code:: -+ -+ scm = -+ # allow scratch builds from any commits -+ bool scratch :: allow -+ # very safe scm, allow anything from there, but only to special target -+ match scm_host very.safe.git.org && buildtag testing-build-tag :: allow -+ match_all branches * !! deny Commit must be present on some branch -+ match_all branches private-* test-* :: deny Private/testing branches are not allowed -+ all :: allow -diff --git a/koji/policy.py b/koji/policy.py -index 729e02e5..8a570575 100644 ---- a/koji/policy.py -+++ b/koji/policy.py -@@ -25,7 +25,7 @@ import logging - import six - - import koji --from koji.util import to_list -+from koji.util import to_list, multi_fnmatch - - - class BaseSimpleTest(object): -@@ -141,6 +141,57 @@ class MatchTest(BaseSimpleTest): - return False - - -+class MatchAnyTest(BaseSimpleTest): -+ """Matches any item of a list/tuple/set value in the data against glob patterns -+ -+ True if any of the expressions matches any item in the list/tuple/set, else False. -+ If the field doesn't exist or isn't a list/tuple/set, the test returns False -+ -+ Syntax: -+ find field pattern1 [pattern2 ...] -+ -+ """ -+ name = 'match_any' -+ field = None -+ -+ def run(self, data): -+ args = self.str.split()[1:] -+ self.field = args[0] -+ args = args[1:] -+ tgt = data.get(self.field) -+ if tgt and isinstance(tgt, (list, tuple, set)): -+ for i in tgt: -+ if i is not None and multi_fnmatch(str(i), args): -+ return True -+ return False -+ -+ -+class MatchAllTest(BaseSimpleTest): -+ """Matches all items of a list/tuple/set value in the data against glob patterns -+ -+ True if any of the expressions matches all items in the list/tuple/set, else False. -+ If the field doesn't exist or isn't a list/tuple/set, the test returns False -+ -+ Syntax: -+ match_all field pattern1 [pattern2 ...] -+ -+ """ -+ name = 'match_all' -+ field = None -+ -+ def run(self, data): -+ args = self.str.split()[1:] -+ self.field = args[0] -+ args = args[1:] -+ tgt = data.get(self.field) -+ if tgt and isinstance(tgt, (list, tuple, set)): -+ for i in tgt: -+ if i is None or not multi_fnmatch(str(i), args): -+ return False -+ return True -+ return False -+ -+ - class TargetTest(MatchTest): - """Matches target in the data against glob patterns - -diff --git a/plugins/builder/scmpolicy.py b/plugins/builder/scmpolicy.py -new file mode 100644 -index 00000000..f120e33b ---- /dev/null -+++ b/plugins/builder/scmpolicy.py -@@ -0,0 +1,72 @@ -+import logging -+import re -+import subprocess -+ -+import six -+ -+from koji import ActionNotAllowed, GenericError -+from koji.plugin import callback -+ -+ -+logger = logging.getLogger('koji.plugins.scmpolicy') -+ -+ -+@callback('postSCMCheckout') -+def assert_scm_policy(clb_type, *args, **kwargs): -+ taskinfo = kwargs['taskinfo'] -+ session = kwargs['session'] -+ build_tag = kwargs['build_tag'] -+ scminfo = kwargs['scminfo'] -+ srcdir = kwargs['srcdir'] -+ scratch = kwargs['scratch'] -+ -+ method = get_task_method(session, taskinfo) -+ -+ policy_data = { -+ 'build_tag': build_tag, -+ 'method': method, -+ 'scratch': scratch, -+ 'branches': get_branches(srcdir) -+ } -+ -+ # Merge scminfo into data with "scm_" prefix. And "scm*" are changed to "scm_*". -+ for k, v in six.iteritems(scminfo): -+ policy_data[re.sub(r'^(scm_?)?', 'scm_', k)] = v -+ -+ logger.info("Checking SCM policy for task %s", taskinfo['id']) -+ logger.debug("Policy data: %r", policy_data) -+ -+ # check the policy -+ try: -+ session.host.assertPolicy('scm', policy_data) -+ logger.info("SCM policy check for task %s: PASSED", taskinfo['id']) -+ except ActionNotAllowed: -+ logger.warning("SCM policy check for task %s: DENIED", taskinfo['id']) -+ raise -+ -+ -+def get_task_method(session, taskinfo): -+ """Get the Task method from taskinfo""" -+ method = None -+ if isinstance(taskinfo, six.integer_types): -+ taskinfo = session.getTaskInfo(taskinfo, strict=True) -+ if isinstance(taskinfo, dict): -+ method = taskinfo.get('method') -+ if method is None: -+ raise GenericError("Invalid taskinfo: %s" % taskinfo) -+ return method -+ -+ -+def get_branches(srcdir): -+ """Determine which remote branches contain the current checkout""" -+ cmd = ['git', 'branch', '-r', '--contains', 'HEAD'] -+ proc = subprocess.Popen(cmd, cwd=srcdir, stdout=subprocess.PIPE) -+ (out, _) = proc.communicate() -+ status = proc.wait() -+ if status != 0: -+ raise Exception('Error getting branches for git checkout') -+ -+ # cut off origin/ prefix -+ branches = [b.strip() for b in out.decode().split('\n') if 'origin/HEAD' not in b and b] -+ branches = [re.sub('^origin/', '', b) for b in branches] -+ return branches --- -GitLab - diff --git a/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch b/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch deleted file mode 100644 index 71f07d5..0000000 --- a/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163 Mon Sep 17 00:00:00 2001 -From: Mike McLean -Date: Feb 05 2024 10:28:43 +0000 -Subject: typo in set_refusal - - -Fixes https://pagure.io/koji/issue/3997 - ---- - -diff --git a/kojihub/scheduler.py b/kojihub/scheduler.py -index 815b0f1..961ef39 100644 ---- a/kojihub/scheduler.py -+++ b/kojihub/scheduler.py -@@ -91,8 +91,8 @@ def get_tasks_for_host(hostID, retry=True): - - def set_refusal(hostID, taskID, soft=True, by_host=False, msg=''): - data = { -- 'task_id': kojihub.convert_value(hostID, cast=int), -- 'host_id': kojihub.convert_value(taskID, cast=int), -+ 'host_id': kojihub.convert_value(hostID, cast=int), -+ 'task_id': kojihub.convert_value(taskID, cast=int), - 'soft': kojihub.convert_value(soft, cast=bool), - 'by_host': kojihub.convert_value(by_host, cast=bool), - 'msg': kojihub.convert_value(msg, cast=str), - diff --git a/3974.patch b/3974.patch deleted file mode 100644 index 7096d54..0000000 --- a/3974.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 36953540662aa39ff1b85218cefededfa4e529a9 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Jan 15 2024 12:48:16 +0000 -Subject: Use dnf5-compatible "group install" command - - - * yum knows only "yum groupinstall" - * dnf < 5 knows both - * dnf-5 only "dnf5 group install" - -It is reasonable to assume that dnf is used in most setups, so changing -default to "group install". If yum is specified *explicitly* via -tags's extra "mock.package_manager", "groupinstall" is used instead. - -Related: https://pagure.io/koji/issue/3971 - ---- - -diff --git a/koji/__init__.py b/koji/__init__.py -index 334b403..9b222cd 100644 ---- a/koji/__init__.py -+++ b/koji/__init__.py -@@ -1804,7 +1804,7 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) - 'target_arch': opts.get('target_arch', arch), - 'chroothome': '/builddir', - # Use the group data rather than a generated rpm -- 'chroot_setup_cmd': 'groupinstall %s' % opts.get('install_group', 'build'), -+ 'chroot_setup_cmd': 'group install %s' % opts.get('install_group', 'build'), - # don't encourage network access from the chroot - 'rpmbuild_networking': opts.get('use_host_resolv', False), - 'use_host_resolv': opts.get('use_host_resolv', False), -@@ -1817,6 +1817,10 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) - config_opts['forcearch'] = opts['forcearch'] - if opts.get('package_manager'): - config_opts['package_manager'] = opts['package_manager'] -+ if opts['package_manager'].endswith('yum'): -+ # backward compatibility with yum (doesn't have separate "group") -+ config_opts['chroot_setup_cmd'] = \ -+ 'groupinstall %s' % opts.get('install_group', 'build') - if opts.get('bootstrap_image'): - config_opts['use_bootstrap_image'] = True - config_opts['bootstrap_image'] = opts['bootstrap_image'] - diff --git a/4013.patch b/4013.patch deleted file mode 100644 index 9b3fae8..0000000 --- a/4013.patch +++ /dev/null @@ -1,52 +0,0 @@ -From bc8e6253f519eeb78fbc8740bba25e8a34490814 Mon Sep 17 00:00:00 2001 -From: Mike McLean -Date: Feb 14 2024 06:40:24 +0000 -Subject: let tag.extra override tag arches for noarch - - ---- - -diff --git a/builder/kojid b/builder/kojid -index b4536dd..8b81d66 100755 ---- a/builder/kojid -+++ b/builder/kojid -@@ -1339,23 +1339,33 @@ class BuildTask(BaseTaskHandler): - exclusivearch = koji.get_header_field(h, 'exclusivearch') - excludearch = koji.get_header_field(h, 'excludearch') - -- if exclusivearch or excludearch: -+ buildconfig = self.session.getBuildConfig(build_tag, event=self.event_id) -+ noarch_arches = buildconfig.get('extra', {}).get('noarch_arches') -+ -+ if exclusivearch or excludearch or noarch_arches: - # if one of the tag arches is filtered out, then we can't use a - # noarch task -- buildconfig = self.session.getBuildConfig(build_tag, event=self.event_id) - arches = buildconfig['arches'] - tag_arches = [koji.canonArch(a) for a in arches.split()] - exclusivearch = [koji.canonArch(a) for a in exclusivearch] - excludearch = [koji.canonArch(a) for a in excludearch] -- archlist = list(tag_arches) -+ # tag.extra overrides tag arches for noarch -+ if noarch_arches: -+ archlist = [koji.canonArch(a) for a in noarch_arches.split()] -+ archlist = [a for a in archlist if a in tag_arches] -+ else: -+ archlist = list(tag_arches) - if exclusivearch: - archlist = [a for a in archlist if a in exclusivearch] - if excludearch: - archlist = [a for a in archlist if a not in excludearch] -+ self.logger.info('Filtering arches for noarch subtask. Choices: %r', archlist) - if not archlist: -- raise koji.BuildError("No valid arches were found. tag %r, " -- "exclusive %r, exclude %r" % (tag_arches, -+ raise koji.BuildError("No valid arches were found. tag %r, extra %r," -+ "exclusive %r, exclude %r" % (tag_arches, noarch_arches, - exclusivearch, excludearch)) -+ self.logger.debug('tag: %r, extra: %r, exclusive: %r, exclude: %r', -+ tag_arches, noarch_arches, exclusivearch, excludearch) - if set(archlist) != set(tag_arches): - return random.choice(archlist) - else: - diff --git a/4026.patch b/4026.patch deleted file mode 100644 index edf0b36..0000000 --- a/4026.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f453092d308605707ba1fb3fa314e05b515e7a25 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Feb 29 2024 10:45:55 +0000 -Subject: Better index for rpm lookup - - -Related: https://pagure.io/koji/issue/4022 - ---- - -diff --git a/schemas/schema-upgrade-1.34-1.35.sql b/schemas/schema-upgrade-1.34-1.35.sql -new file mode 100644 -index 0000000..3cc82bc ---- /dev/null -+++ b/schemas/schema-upgrade-1.34-1.35.sql -@@ -0,0 +1,9 @@ -+-- upgrade script to migrate the Koji database schema -+-- from version 1.33 to 1.34 -+ -+BEGIN; -+ -+CREATE INDEX CONCURRENTLY IF NOT EXISTS rpminfo_nvra -+ ON rpminfo(name,version,release,arch,external_repo_id); -+ -+COMMIT; -diff --git a/schemas/schema.sql b/schemas/schema.sql -index e5f3462..7e3298c 100644 ---- a/schemas/schema.sql -+++ b/schemas/schema.sql -@@ -752,6 +752,7 @@ CREATE TABLE rpminfo ( - CREATE INDEX rpminfo_build ON rpminfo(build_id); - CREATE UNIQUE INDEX rpminfo_unique_nvra_not_draft ON rpminfo(name,version,release,arch,external_repo_id) - WHERE draft IS NOT TRUE; -+CREATE INDEX rpminfo_nvra ON rpminfo(name,version,release,arch,external_repo_id); - -- index for default search method for rpms, PG11+ can benefit from new include method - DO $$ - DECLARE version integer; - diff --git a/4100.patch b/4100.patch deleted file mode 100644 index dfc8227..0000000 --- a/4100.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a241746b2a496540bb6cbe64a5b59eb5bb1c50a6 Mon Sep 17 00:00:00 2001 -From: Miro Hrončok -Date: May 28 2024 20:10:07 +0000 -Subject: setup.py: Fix version retrieval on Python 3.13+ - - -Accessing __version__ from locals() no longer works. - -This was reported to Python in https://github.com/python/cpython/issues/118888 -but according to Python developers, it: - - - is an intended change of behavior described in PEP 667 - - was an illegal usage that happens to work in a favored way to begin with - ---- - -diff --git a/setup.py b/setup.py -index 91f7d76..4d38c08 100755 ---- a/setup.py -+++ b/setup.py -@@ -25,8 +25,9 @@ def get_install_requires(): - - def get_version(): - cwd = os.path.dirname(__file__) -- exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read()) -- return locals()['__version__'] -+ lcls = {} -+ exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read(), None, lcls) -+ return lcls['__version__'] - - - def get_long_description(): - diff --git a/koji.spec b/koji.spec index 9ea11e5..9da7390 100644 --- a/koji.spec +++ b/koji.spec @@ -8,8 +8,8 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.34.1 -Release: 6%{?dist} +Version: 1.35.0 +Release: 1%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ # Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended. License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-or-later @@ -17,37 +17,8 @@ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 -# scm policy plugin - already upstreamed but not released yet -Patch1: 1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch # Not upstreamable Patch100: fedora-config.patch -# Use dnf5-compatible "group install" command -# This should work on yum/dnf-4/dnf5 -Patch101: https://pagure.io/koji/pull-request/3974.patch -# noarch builds only happen on some arches -# allows picking what arches will do noarch builds -Patch102: https://pagure.io/koji/pull-request/4013.patch -# Add index for rpminfo -Patch103: https://pagure.io/koji/pull-request/4026.patch -# setup.py: Fix version retrieval on Python 3.13+ -Patch104: https://pagure.io/koji/pull-request/4100.patch -# kiwi image name override support, upstream but not released yet -# https://pagure.io/koji/pull-request/4157 -Patch105: 0001-kiwi-Add-support-for-overriding-image-type-attribute.patch -Patch106: 0002-kiwi-Add-support-for-overriding-kiwi-image-file-name.patch -# Fix a typo in the image-type-attribute patch -# https://pagure.io/koji/pull-request/4181 -Patch107: 0001-Fix-a-typo-in-the-kiwi-image-type-attribute-override.patch -# kiwi: only add buildroot repo if user repositories are not defined -# https://pagure.io/koji/pull-request/4063 -Patch108: 0001-kiwi-Only-add-buildroot-repo-if-user-repositories-ar.patch -Patch109: 0002-kiwi-option-for-not-using-buildroot-repo.patch -Patch110: 0003-Don-t-use-buildroot-repo-by-default.patch -Patch111: 0004-version-check-typo-fixes.patch -Patch112: 0005-improve-warnings-for-older-hub.patch -# Allow overriding version and releasever for kiwi -# https://pagure.io/koji/pull-request/4184 -Patch113: 0006-kiwi-Add-support-for-overriding-version-and-releasev.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} @@ -391,6 +362,9 @@ done %systemd_postun kojira.service %changelog +* Wed Sep 18 2024 Kevin Fenzi - 1.35.0-1 +- Update to 1.35.0. Fixes rhbz#2312848 + * Mon Sep 02 2024 Miroslav Suchý - 1.34.1-6 - convert license to SPDX diff --git a/sources b/sources index b15b58b..8737089 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (koji-1.34.1.tar.bz2) = ed55e8c16239ba43e1b931d6b16523530ede77c087f93828e53f30aec9514e81d252adb7e64c1194f7fc4e9db33ee4e6c74841f07dfc688d6bb68bd9b7bd80b6 +SHA512 (koji-1.35.0.tar.bz2) = e4bfa99478d5a47414a176c7972cef7351e6bc2f06bcb34ea536800acbdd725bb7b65acb01403b786f64a0f727cd85a87b9bb03bd7884f0c442b986ffb71d3a0