From 52383fa92a55f2c4492c432519ad7b6b8bb6e0b1 Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Mar 24 2020 01:31:22 +0000 Subject: New release 1.60 Signed-off-by: Ondřej Nosek --- diff --git a/.gitignore b/.gitignore index 7483756..0071ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ /rpkg-1.57.tar.gz /rpkg-1.58.tar.gz /rpkg-1.59.tar.gz +/rpkg-1.60.tar.gz diff --git a/0001-Repair-downloading-sources-into-external-directory.patch b/0001-Repair-downloading-sources-into-external-directory.patch new file mode 100644 index 0000000..c1b1511 --- /dev/null +++ b/0001-Repair-downloading-sources-into-external-directory.patch @@ -0,0 +1,31 @@ +From ae1135dfbca05ddcd88bbcc962baf589dba143e1 Mon Sep 17 00:00:00 2001 +From: Ondrej Nosek +Date: Tue, 24 Mar 2020 01:23:53 +0100 +Subject: [PATCH] Repair downloading sources into external directory + +Signed-off-by: Ondrej Nosek +--- + pyrpkg/utils.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/pyrpkg/utils.py b/pyrpkg/utils.py +index e6339db..d1b79b9 100644 +--- a/pyrpkg/utils.py ++++ b/pyrpkg/utils.py +@@ -185,8 +185,11 @@ def is_file_tracked(file_path, repo_path): + # create a repo object from our path + try: + repo = git.Repo(repo_path) +- except (git.InvalidGitRepositoryError, git.NoSuchPathError): +- raise RuntimeError("%s is not a valid repo" % repo_path) ++ except git.InvalidGitRepositoryError: ++ # repo_path is not a valid repo - input file is not tracked ++ return False ++ except git.NoSuchPathError: ++ raise RuntimeError("%s is not a valid path" % repo_path) + + if relative_file_path in repo.untracked_files: + return False +-- +2.21.1 + diff --git a/0001-Reuse-koji_cli.lib.unique_path.patch b/0001-Reuse-koji_cli.lib.unique_path.patch deleted file mode 100644 index 45d3bb4..0000000 --- a/0001-Reuse-koji_cli.lib.unique_path.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0ee52cf747e218008984d604c468f9e1515f1ef9 Mon Sep 17 00:00:00 2001 -From: Chenxiong Qi -Date: Mon, 15 Apr 2019 11:17:21 +0800 -Subject: [PATCH 1/5] Reuse koji_cli.lib.unique_path - -Call this method instead of constructing the path by rpkg itself. - -Merges: https://pagure.io/rpkg/pull-request/336 - -Signed-off-by: Chenxiong Qi ---- - pyrpkg/cli.py | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py -index 6b584ae..7ab146d 100644 ---- a/pyrpkg/cli.py -+++ b/pyrpkg/cli.py -@@ -18,11 +18,8 @@ import argparse - import getpass - import logging - import os --import random - import re --import string - import sys --import time - from gettext import gettext as _ # For `_ArgumentParser' - - import requests -@@ -1646,11 +1643,9 @@ see API KEY section of copr-cli(1) man page. - callback = None - if not self.args.q: - callback = koji_cli.lib._progress_callback -- # define a unique path for this upload. Stolen from /usr/bin/koji -- uniquepath = 'cli-build/%r.%s' % ( -- time.time(), -- ''.join([random.choice(string.ascii_letters) for i in range(8)]) -- ) -+ # Define a unique path for this upload. Learned from koji to use prefix -+ # cli-build. -+ uniquepath = koji_cli.lib.unique_path('cli-build') - if not name: - name = os.path.basename(file) - # Should have a try here, not sure what errors we'll get yet though --- -2.21.0 - diff --git a/0002-Pass-skip_build-option-to-buildContainer.patch b/0002-Pass-skip_build-option-to-buildContainer.patch deleted file mode 100644 index 55580a1..0000000 --- a/0002-Pass-skip_build-option-to-buildContainer.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 48e3ce2f754ba9b30b195a3c48ffdfb2b147d1ab Mon Sep 17 00:00:00 2001 -From: Robert Cerven -Date: Mon, 7 Oct 2019 21:32:46 +0200 -Subject: [PATCH 2/5] Pass skip_build option to buildContainer - -* OSBS-7711 - -Signed-off-by: Robert Cerven ---- - pyrpkg/__init__.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 68aceb2..8e0960b 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3126,7 +3126,8 @@ class Commands(object): - - task_opts = {} - for key in ('scratch', 'name', 'version', 'release', -- 'yum_repourls', 'git_branch', 'signing_intent', 'compose_ids'): -+ 'yum_repourls', 'git_branch', 'signing_intent', 'compose_ids', -+ 'skip_build'): - if key in opts: - task_opts[key] = opts[key] - --- -2.21.0 - diff --git a/0002-Repair-compatible-formatting-for-Python-2.6.patch b/0002-Repair-compatible-formatting-for-Python-2.6.patch new file mode 100644 index 0000000..9fcc464 --- /dev/null +++ b/0002-Repair-compatible-formatting-for-Python-2.6.patch @@ -0,0 +1,93 @@ +From abe0b0a9b650b1d55c2482d10ad8898f0efc00ea Mon Sep 17 00:00:00 2001 +From: Ondrej Nosek +Date: Tue, 24 Mar 2020 02:05:19 +0100 +Subject: [PATCH] Repair compatible formatting for Python 2.6 + +Signed-off-by: Ondrej Nosek +--- + pyrpkg/__init__.py | 12 ++++++------ + pyrpkg/utils.py | 8 ++++---- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py +index 50f3302..791b66b 100644 +--- a/pyrpkg/__init__.py ++++ b/pyrpkg/__init__.py +@@ -1358,14 +1358,14 @@ class Commands(object): + target_dir = tempfile.mkdtemp(suffix="extract-srpm", prefix="rpkg") + try: + try: +- self.log.debug("Extracting srpm '{}', destination '{}'".format( ++ self.log.debug("Extracting srpm '{0}', destination '{1}'".format( + srpm, target_dir + )) + # method 'is_lookaside_eligible_file' will access extracted + # files to detect its encoding (binary or not) + _, _ = extract_srpm(srpm, target_dir) + except Exception as e: +- self.log.error("Extraction of srpm has failed {}".format(e)) ++ self.log.error("Extraction of srpm has failed {0}".format(e)) + raise + + # Cycle through the srpm content and decide where to upload files +@@ -1633,8 +1633,8 @@ class Commands(object): + namespace = repo.split("/")[0] if "/" in repo else "rpms" + # Has current namespace its own clone config? + selected_clone_config = None +- if hasattr(self, "clone_config_{}".format(namespace)): +- selected_clone_config = getattr(self, "clone_config_{}".format(namespace)) ++ if hasattr(self, "clone_config_{0}".format(namespace)): ++ selected_clone_config = getattr(self, "clone_config_{0}".format(namespace)) + + # Valid configuration is non-empty string + if selected_clone_config: +@@ -1875,10 +1875,10 @@ class Commands(object): + os.remove(file) + + try: +- self.log.debug("Extracting srpm '{}'".format(srpm)) ++ self.log.debug("Extracting srpm '{0}'".format(srpm)) + output, err = extract_srpm(srpm) + except Exception as e: +- self.log.error("Extraction of srpm has failed {}".format(e)) ++ self.log.error("Extraction of srpm has failed {0}".format(e)) + raise + if output: + self.log.debug(output) +diff --git a/pyrpkg/utils.py b/pyrpkg/utils.py +index d1b79b9..1a50a3e 100644 +--- a/pyrpkg/utils.py ++++ b/pyrpkg/utils.py +@@ -251,9 +251,9 @@ def extract_srpm(srpm_path, target_dir=None): + directory if not specified + """ + if not os.path.isfile(srpm_path): +- raise IOError("Input file doesn't exist: {}".format(srpm_path)) ++ raise IOError("Input file doesn't exist: {0}".format(srpm_path)) + if target_dir and not os.path.isdir(target_dir): +- raise IOError("Target directory doesn't exist: {}".format(target_dir)) ++ raise IOError("Target directory doesn't exist: {0}".format(target_dir)) + + # rpm2cpio | cpio -iud --quiet + cmd = ['rpm2cpio', srpm_path] +@@ -272,7 +272,7 @@ def is_lookaside_eligible_file(file_name, dir_path=None): + """ + file_path = os.path.join(dir_path or "", file_name) + if not os.path.isfile(file_path): +- raise IOError("Input file doesn't exist: {}".format(file_path)) ++ raise IOError("Input file doesn't exist: {0}".format(file_path)) + + p = subprocess.Popen( + # parameter '-b' causes brief output - without filename in the output +@@ -284,7 +284,7 @@ def is_lookaside_eligible_file(file_name, dir_path=None): + ) + output, errors = p.communicate() + if errors: +- raise RuntimeError("Mime encoding detection of the file '{}' has failed: {}".format( ++ raise RuntimeError("Mime encoding detection of the file '{0}' has failed: {1}".format( + file_path, + errors + )) +-- +2.21.1 + diff --git a/0003-container-build-add-isolated-argument.patch b/0003-container-build-add-isolated-argument.patch deleted file mode 100644 index ddc9f71..0000000 --- a/0003-container-build-add-isolated-argument.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 174f61ce13d47c84a1a9f697c7c6b7c817db73f7 Mon Sep 17 00:00:00 2001 -From: Ken Dreyer -Date: Wed, 25 Sep 2019 11:56:21 -0600 -Subject: [PATCH 3/5] container-build: add --isolated argument - -Add support for a new "--isolated" argument to the container-build -sub-command. - -Isolated builds will only update the {version}-{release} unique tag and -the primary tag in target container registry. Also, OSBS's bump_release -plugin will ignore isolated builds. - -Users must specify a --build-release argument when the use the ---isolated argument. - -Signed-off-by: Ken Dreyer ---- - pyrpkg/__init__.py | 2 +- - pyrpkg/cli.py | 13 +++++++++++++ - tests/test_cli.py | 4 ++++ - 3 files changed, 18 insertions(+), 1 deletion(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 8e0960b..1aa1c2b 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3125,7 +3125,7 @@ class Commands(object): - source = self.construct_build_url() - - task_opts = {} -- for key in ('scratch', 'name', 'version', 'release', -+ for key in ('scratch', 'name', 'version', 'release', 'isolated', - 'yum_repourls', 'git_branch', 'signing_intent', 'compose_ids', - 'skip_build'): - if key in opts: -diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py -index 7ab146d..0845d99 100644 ---- a/pyrpkg/cli.py -+++ b/pyrpkg/cli.py -@@ -1544,6 +1544,13 @@ see API KEY section of copr-cli(1) man page. - default=None, - help="Specify a release value for this build's NVR") - -+ parser.add_argument( -+ '--isolated', -+ help='Do not auto-increment the release value or update' -+ ' additional tags in the registry. You must use the' -+ ' --build-release argument', -+ action="store_true") -+ - parser.add_argument( - '--scratch', - help='Scratch build', -@@ -1981,6 +1988,7 @@ see API KEY section of copr-cli(1) man page. - opts = {"scratch": self.args.scratch, - "quiet": self.args.q, - "release": self.args.build_release, -+ "isolated": self.args.isolated, - "git_branch": self.cmd.branch_merge, - "arches": self.args.arches, - "skip_build": self.args.skip_build} -@@ -1995,6 +2003,11 @@ see API KEY section of copr-cli(1) man page. - "signing_intent": self.args.signing_intent, - }) - -+ if self.args.isolated and not self.args.build_release: -+ self.container_build_parser.error( -+ 'missing --build-release: using --isolated requires' -+ ' --build-release option') -+ - section_name = "%s.container-build" % self.name - err_msg = "Missing %(option)s option in [%(plugin.section)s] section. " \ - "Using %(option)s from [%(root.section)s]" -diff --git a/tests/test_cli.py b/tests/test_cli.py -index ae87030..35b37d6 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -224,6 +224,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'scratch': False, - 'quiet': False, - 'release': None, -+ 'isolated': False, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -254,6 +255,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'scratch': False, - 'quiet': False, - 'release': None, -+ 'isolated': False, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -293,6 +295,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'scratch': False, - 'quiet': False, - 'release': None, -+ 'isolated': False, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -350,6 +353,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'scratch': False, - 'quiet': False, - 'release': None, -+ 'isolated': False, - 'git_branch': 'eng-rhel-7', - 'arches': None, - 'skip_build': False --- -2.21.0 - diff --git a/0004-tests-add-container-build-isolated-test.patch b/0004-tests-add-container-build-isolated-test.patch deleted file mode 100644 index d3994b3..0000000 --- a/0004-tests-add-container-build-isolated-test.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 10de8c40d2f2964ce0c4f643a143c59e5fa11f94 Mon Sep 17 00:00:00 2001 -From: Ken Dreyer -Date: Fri, 11 Oct 2019 09:42:22 -0600 -Subject: [PATCH 4/5] tests: add container-build --isolated test - -Verify the behavior of the container-build "--isolated" option. - -Signed-off-by: Ken Dreyer ---- - tests/test_cli.py | 30 ++++++++++++++++++++++++++++++ - 1 file changed, 30 insertions(+) - -diff --git a/tests/test_cli.py b/tests/test_cli.py -index 35b37d6..fa18647 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -271,6 +271,36 @@ class TestContainerBuildWithKoji(CliTestCase): - flatpak=False - ) - -+ def test_isolated(self): -+ cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'container-build', -+ '--isolated', '--build-release', '99'] -+ -+ with patch('sys.argv', new=cli_cmd): -+ cli = self.new_cli() -+ cli.container_build_koji() -+ -+ self.mock_container_build_koji.assert_called_once_with( -+ False, -+ opts={ -+ 'scratch': False, -+ 'quiet': False, -+ 'release': '99', -+ 'isolated': True, -+ 'yum_repourls': None, -+ 'git_branch': 'eng-rhel-7', -+ 'arches': None, -+ 'signing_intent': None, -+ 'compose_ids': None, -+ 'skip_build': False -+ }, -+ kojiconfig=None, -+ kojiprofile='koji', -+ build_client=utils.build_client, -+ koji_task_watcher=koji_cli.lib.watch_tasks, -+ nowait=False, -+ flatpak=False -+ ) -+ - def test_using_deprecated_kojiconfig(self): - """test_build_using_deprecated_kojiconfig - --- -2.21.0 - diff --git a/0005-container-build-add-koji-parent-build-argument.patch b/0005-container-build-add-koji-parent-build-argument.patch deleted file mode 100644 index 4efcb65..0000000 --- a/0005-container-build-add-koji-parent-build-argument.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 4b48dbcba45bf3ad44a3179380972b3ad6997616 Mon Sep 17 00:00:00 2001 -From: Ken Dreyer -Date: Fri, 11 Oct 2019 09:42:08 -0600 -Subject: [PATCH 5/5] container-build: add --koji-parent-build argument - -Add support for a new "--koji-parent-build" argument to the -container-build sub-command. - -OSBS allows users to dynamically override the Dockerfile's "FROM" image -at build time. This allows you to build your container against a -specific parent image without pushing changes to dist-git. - -Signed-off-by: Ken Dreyer ---- - pyrpkg/__init__.py | 4 ++-- - pyrpkg/cli.py | 7 +++++++ - tests/test_cli.py | 5 +++++ - 3 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 1aa1c2b..b139fe0 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3126,8 +3126,8 @@ class Commands(object): - - task_opts = {} - for key in ('scratch', 'name', 'version', 'release', 'isolated', -- 'yum_repourls', 'git_branch', 'signing_intent', 'compose_ids', -- 'skip_build'): -+ 'koji_parent_build', 'yum_repourls', 'git_branch', -+ 'signing_intent', 'compose_ids', 'skip_build'): - if key in opts: - task_opts[key] = opts[key] - -diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py -index 0845d99..0036136 100644 ---- a/pyrpkg/cli.py -+++ b/pyrpkg/cli.py -@@ -1551,6 +1551,12 @@ see API KEY section of copr-cli(1) man page. - ' --build-release argument', - action="store_true") - -+ parser.add_argument( -+ '--koji-parent-build', -+ default=None, -+ help='Specify a Koji NVR for the parent container image. This' -+ ' will override the "FROM" value in your Dockerfile.') -+ - parser.add_argument( - '--scratch', - help='Scratch build', -@@ -1989,6 +1995,7 @@ see API KEY section of copr-cli(1) man page. - "quiet": self.args.q, - "release": self.args.build_release, - "isolated": self.args.isolated, -+ "koji_parent_build": self.args.koji_parent_build, - "git_branch": self.cmd.branch_merge, - "arches": self.args.arches, - "skip_build": self.args.skip_build} -diff --git a/tests/test_cli.py b/tests/test_cli.py -index fa18647..0868a30 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -225,6 +225,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'quiet': False, - 'release': None, - 'isolated': False, -+ 'koji_parent_build': None, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -256,6 +257,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'quiet': False, - 'release': None, - 'isolated': False, -+ 'koji_parent_build': None, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -286,6 +288,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'quiet': False, - 'release': '99', - 'isolated': True, -+ 'koji_parent_build': None, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -326,6 +329,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'quiet': False, - 'release': None, - 'isolated': False, -+ 'koji_parent_build': None, - 'yum_repourls': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, -@@ -384,6 +388,7 @@ class TestContainerBuildWithKoji(CliTestCase): - 'quiet': False, - 'release': None, - 'isolated': False, -+ 'koji_parent_build': None, - 'git_branch': 'eng-rhel-7', - 'arches': None, - 'skip_build': False --- -2.21.0 - diff --git a/0006-Isolated-container-build-should-allow-arches-overrid.patch b/0006-Isolated-container-build-should-allow-arches-overrid.patch deleted file mode 100644 index 462a777..0000000 --- a/0006-Isolated-container-build-should-allow-arches-overrid.patch +++ /dev/null @@ -1,57 +0,0 @@ -From c0c26f8512e5369b4616a98a34de306c666c709f Mon Sep 17 00:00:00 2001 -From: Robert Cerven -Date: Mon, 4 Nov 2019 15:29:06 +0100 -Subject: [PATCH] Isolated container-build should allow arches override - -JIRA: OSBS-8025 -Merges: https://pagure.io/rpkg/pull-request/471 - -Signed-off-by: Robert Cerven ---- - pyrpkg/__init__.py | 6 ++++-- - pyrpkg/cli.py | 4 ++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index b139fe0..bcacca1 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3133,9 +3133,11 @@ class Commands(object): - - scratch = opts.get('scratch') - arches = opts.get('arches') -+ isolated = opts.get('isolated') - if arches: -- if not scratch: -- raise rpkgError('Cannot override arches for non-scratch builds') -+ if not (scratch or isolated): -+ raise rpkgError('Cannot override arches for non-scratch and non-isolated ' -+ 'builds') - task_opts['arch_override'] = ' '.join(arches) - - if flatpak: -diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py -index 0036136..eb17284 100644 ---- a/pyrpkg/cli.py -+++ b/pyrpkg/cli.py -@@ -1566,7 +1566,7 @@ see API KEY section of copr-cli(1) man page. - '--arches', - action='store', - nargs='*', -- help='Limit a scratch build to an arch. May have multiple arches.') -+ help='Limit a scratch or a isolated build to an arch. May have multiple arches.') - - parser.add_argument( - '--skip-remote-rules-validation', -@@ -2270,7 +2270,7 @@ see API KEY section of copr-cli(1) man page. - build_id, auth_method, oidc_id_provider, oidc_client_id, - oidc_client_secret, oidc_scopes) - if not self.args.q: -- print('The module build #{0} was cancelled'.format(build_id)) -+ print('The module build #{0} was cancelled'.format(build_id)) - - def module_build_info(self): - """Show information about an MBS build""" --- -2.21.0 - diff --git a/0007-Use-a-single-thread-pool-while-watching-module-build.patch b/0007-Use-a-single-thread-pool-while-watching-module-build.patch deleted file mode 100644 index 3e51257..0000000 --- a/0007-Use-a-single-thread-pool-while-watching-module-build.patch +++ /dev/null @@ -1,43 +0,0 @@ -From a99a9a447e809c280bc996b9ed6aba3c4a3a2360 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= -Date: Tue, 3 Dec 2019 12:12:00 +0100 -Subject: [PATCH] Use a single thread pool while watching module builds -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Calling the Pool() constructor on each iteration leaks the threads, -leading to a "can't start new thread" error during long waits. - -This can be aggravated by the constructor being called without an -argument, which by default uses the systems CPU count to create the -pool. When running in a container in a cloud environment this number can -be unexpectedly large (for example, 64). - -Reuse the pool and limit the number of threads in the pool. - -Signed-off-by: Hunor Csomortáni ---- - pyrpkg/__init__.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 67cff94..ab0ad39 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3826,8 +3826,11 @@ class Commands(object): - return stats - - def get_watched_module_builds(self, build_ids): -+ # Limit the number of threads to an arbitrary 8, -+ # to avoid starting too many threads when running in a -+ # container in the cloud. -+ pool = ThreadPool(min(8, len(build_ids) or 1)) - while True: -- pool = ThreadPool() - module_builds = pool.map(self.module_get_build, build_ids) - - for module_build in module_builds: --- -2.21.0 - diff --git a/0008-Propagate-module_hotfixes-to-getMockConfig.patch b/0008-Propagate-module_hotfixes-to-getMockConfig.patch deleted file mode 100644 index 10f0aca..0000000 --- a/0008-Propagate-module_hotfixes-to-getMockConfig.patch +++ /dev/null @@ -1,62 +0,0 @@ -From cf8d67db902203d18e86378632e22454deb960b4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= -Date: Mon, 16 Dec 2019 16:10:46 +0100 -Subject: [PATCH] Propagate module_hotfixes to getMockConfig -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The Koji cli does this, and any wrapper tool should too to generate the -same output. - -Resolves: rhbz#1780228 -Signed-off-by: Lubomír Sedlář ---- - pyrpkg/__init__.py | 2 ++ - tests/test_cli.py | 3 ++- - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 7fbc6c2..2dddad7 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -2646,6 +2646,7 @@ class Commands(object): - build_target["build_tag_name"] - ) - package_manager = build_config.get("extra", {}).get("mock.package_manager") -+ module_hotfixes = build_config.get("extra", {}).get("mock.yum.module_hotfixes") - - # Generate the config - config = koji.genMockConfig( -@@ -2656,6 +2657,7 @@ class Commands(object): - repoid=repoid, - topurl=self.topurl, - package_manager=package_manager, -+ module_hotfixes=module_hotfixes, - ) - - # Return the mess -diff --git a/tests/test_cli.py b/tests/test_cli.py -index bc9745f..d80243d 100644 ---- a/tests/test_cli.py -+++ b/tests/test_cli.py -@@ -1724,7 +1724,7 @@ class TestMockConfig(CliTestCase): - self.kojisession.getBuildTarget.return_value = self.fake_build_target - self.kojisession.getRepo.return_value = self.fake_repo - self.kojisession.getBuildConfig.return_value = { -- "extra": {"mock.package_manager": "dnf"} -+ "extra": {"mock.package_manager": "dnf", "mock.yum.module_hotfixes": 1} - } - - def tearDown(self): -@@ -1751,6 +1751,7 @@ class TestMockConfig(CliTestCase): - repoid=self.fake_repo['id'], - topurl='http://localhost/hub', - package_manager="dnf", -+ module_hotfixes=1, - ) - - mock_config = stdout.getvalue().strip() --- -2.21.0 - diff --git a/0009-Don-t-expect-module-build-tasks-to-have-rpms.patch b/0009-Don-t-expect-module-build-tasks-to-have-rpms.patch deleted file mode 100644 index 9f7c0a2..0000000 --- a/0009-Don-t-expect-module-build-tasks-to-have-rpms.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 02affb458224f39eb4593cfba8dead8d2faa5084 Mon Sep 17 00:00:00 2001 -From: Mariana Ulaieva -Date: Mon, 16 Dec 2019 14:07:04 +0100 -Subject: [PATCH] Don't expect module build tasks to have "rpms" - -There are module builds, which won't build any components.There are -module builds, which won't build any components. These module builds -won't have an "rpms" key in "tasks". - -Expect this to happen and don't fail when watching module builds of -this kind. - -Merges: https://pagure.io/rpkg/pull-request/476 - -Signed-off-by: Mariana Ulaieva ---- - pyrpkg/__init__.py | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 2dddad7..3271a03 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3795,7 +3795,8 @@ class Commands(object): - continue - stats[stats_key_mapping[task_state]] = n - stats['completion_percentage'] = \ -- int(float(stats['done'] + stats['failed']) / stats['total'] * 100) -+ int(float(stats['done'] + stats['failed']) / stats['total'] * 100) \ -+ if stats['total'] > 0 else 100 # to avoid zero division when there were no task_infos - return stats - - def get_watched_module_builds(self, build_ids): -@@ -3823,7 +3824,7 @@ class Commands(object): - # with -1 so that None does not impact the comparison for - # sort. - formatted_tasks = [] -- for pkg_name, task_info in module_build['tasks']['rpms'].items(): -+ for pkg_name, task_info in module_build['tasks'].get('rpms', {}).items(): - new_task_info = task_info.copy() - new_task_info['package_name'] = pkg_name - if new_task_info['state'] is None: --- -2.21.0 - diff --git a/0010-RPM-4.15-changed-header-returns-from-type-bytes-to-s.patch b/0010-RPM-4.15-changed-header-returns-from-type-bytes-to-s.patch deleted file mode 100644 index 64e9553..0000000 --- a/0010-RPM-4.15-changed-header-returns-from-type-bytes-to-s.patch +++ /dev/null @@ -1,48 +0,0 @@ -From fdc40f7be78e120f6b880d352cc916f39d36477f Mon Sep 17 00:00:00 2001 -From: Merlin Mathesius -Date: Thu, 19 Dec 2019 07:48:20 -0600 -Subject: [PATCH] RPM 4.15 changed header returns from type 'bytes' to - 'string'. Handle either by converting to 'string' if necessary. - -Signed-off-by: Merlin Mathesius ---- - pyrpkg/cli.py | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py -index a26e1be..6ae3d37 100644 ---- a/pyrpkg/cli.py -+++ b/pyrpkg/cli.py -@@ -1683,6 +1683,20 @@ class cliClient(object): - contain RPM data. - :rtype: str - """ -+ -+ def _string(s): -+ """RPM 4.15 changed header returns from type 'bytes' to 'string'. -+ Handle either by always returning 'string'. -+ -+ :param s: a 'bytes' or 'string' value representing an RPM -+ package header. -+ :return: always a 'string' representation of the RPM header. -+ :rtype: str -+ """ -+ if isinstance(s, bytes): -+ return s.decode('utf-8') -+ return s -+ - ts = rpm.TransactionSet() - ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) - fdno = os.open(rpm_file, os.O_RDONLY) -@@ -1691,7 +1705,7 @@ class cliClient(object): - except rpm.error: - return None - os.close(fdno) -- return hdr[rpm.RPMTAG_NAME].decode('utf-8') -+ return _string(hdr[rpm.RPMTAG_NAME]) - - def _handle_srpm_option(self): - """Generate SRPM according to --srpm option value and upload it --- -2.21.0 - diff --git a/0011-Create-stats-for-module-builds-in-init-state.patch b/0011-Create-stats-for-module-builds-in-init-state.patch deleted file mode 100644 index 152d286..0000000 --- a/0011-Create-stats-for-module-builds-in-init-state.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 5cce3d5957afd757fb4b4cebacb6d7f72510d78d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= -Date: Tue, 17 Dec 2019 10:40:46 +0100 -Subject: [PATCH] Create stats for module builds in 'init' state -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When watching builds, the dictionary to track module build progress was -not populated with tracking information due to an early 'continue' -statement. - -This caused watching builds fail when builds transitioned from 'init' to -'build' state between two watch cycles, with: - - Could not execute module_build: 'tasks_stats' - -This happened when building modules without any components and starting -the watch as soon as the build was submitted. - -Treating 'init' as any other state solves this issue, as the 'build' -branch in 'module_watch_build()' will find tracking information -pre-populated. - -This is safe to do since 02affb4: we won't fail on an empty 'tasks' -dictionary. - -Signed-off-by: Hunor Csomortáni - -Merges: https://pagure.io/rpkg/pull-request/478 ---- - pyrpkg/__init__.py | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py -index 3271a03..7236563 100644 ---- a/pyrpkg/__init__.py -+++ b/pyrpkg/__init__.py -@@ -3812,9 +3812,6 @@ class Commands(object): - module_build['link'] = \ - self.module_get_url(module_build['id']).split('?')[0] - -- if module_build['state_name'] == 'init': -- continue -- - # tasks/rpms is a mapping from package name to package info, - # e.g. {'pkg': {'nvr': ..., 'task_id': ..., 'state': ...}} - # The injected task info will look like: --- -2.21.0 - diff --git a/rpkg.spec b/rpkg.spec index e7b2c7e..9ea77f7 100644 --- a/rpkg.spec +++ b/rpkg.spec @@ -1,6 +1,6 @@ Name: rpkg -Version: 1.59 -Release: 6%{?dist} +Version: 1.60 +Release: 1%{?dist} Summary: Python library for interacting with rpm+git License: GPLv2+ and LGPLv2 @@ -17,30 +17,17 @@ Source0: https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz # and there is only old rpm-python package in EL6 and 7, so just simply to # remove rpm-py-installer for now. Patch0: remove-koji-and-rpm-py-installer-from-requires.patch -Patch1: 0001-Reuse-koji_cli.lib.unique_path.patch -Patch2: 0002-Pass-skip_build-option-to-buildContainer.patch -Patch3: 0003-container-build-add-isolated-argument.patch -Patch4: 0004-tests-add-container-build-isolated-test.patch -Patch5: 0005-container-build-add-koji-parent-build-argument.patch -Patch6: 0006-Isolated-container-build-should-allow-arches-overrid.patch -Patch7: 0007-Use-a-single-thread-pool-while-watching-module-build.patch -Patch8: 0008-Propagate-module_hotfixes-to-getMockConfig.patch -Patch9: 0009-Don-t-expect-module-build-tasks-to-have-rpms.patch -Patch10: 0010-RPM-4.15-changed-header-returns-from-type-bytes-to-s.patch -Patch11: 0011-Create-stats-for-module-builds-in-init-state.patch +Patch1: 0001-Repair-downloading-sources-into-external-directory.patch +Patch2: 0002-Repair-compatible-formatting-for-Python-2.6.patch %if 0%{?fedora} || 0%{?rhel} > 7 -# Enable python3 build by default -%global with_python3 1 -%else -%global with_python3 0 -%endif - -%if 0%{?fedora} > 29 || 0%{?rhel} > 7 # Disable python2 build by default %global with_python2 0 +# Enable python3 build by default +%global with_python3 1 %else %global with_python2 1 +%global with_python3 0 # sitelib for noarch packages, sitearch for others (remove the unneeded one) %{!?python2_sitelib: %global python2_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?__python2: %global __python2 %{__python}} @@ -128,7 +115,8 @@ Obsoletes: pyrpkg < 1.49-2 %description -n python2-%{name} A python library for managing RPM package sources in a git repository. -%endif # with python2 +%endif +# end of python2 section %if 0%{?with_python3} @@ -185,7 +173,8 @@ Conflicts: fedpkg < 1.26 %description -n python3-%{name} A python library for managing RPM package sources in a git repository. -%endif # with python3 +%endif +# end of python3 section %package common @@ -265,7 +254,7 @@ nosetests tests # For noarch packages: sitelib %{python2_sitelib}/pyrpkg %{python2_sitelib}/%{name}-%{version}-py*.egg-info -%endif # with python2 +%endif %if 0%{?with_python3} %files -n python3-%{name} @@ -273,7 +262,7 @@ nosetests tests %license COPYING COPYING-koji LGPL %{python3_sitelib}/pyrpkg %{python3_sitelib}/%{name}-%{version}-py*.egg-info -%endif # with python3 +%endif %files common %{_datadir}/%{name} @@ -281,6 +270,35 @@ nosetests tests %changelog +* Fri Mar 20 2020 Ondřej Nosek - 1.60-1 +- More transparent check of retired package (onosek) +- Run newer version of sphinx-build tool (onosek) +- Lookaside cache upload is not based on an extension - #484 (onosek) +- container-build: additional warning when using --release (mlangsdo) +- allow compose-id with repo-url for container_build (rcerven) +- Clone config customization for namespaces - 231 (onosek) +- Repair Jenkins tests (onosek) +- (new-)sources should fail with git tracked files - 241 (onosek) +- Handle new cachito dependency replacement argument (athoscr) +- module-build optional key help - 280 (onosek) +- Modify watch-cancel message (sgallagh) +- Create stats for module builds in 'init' state (csomh) +- RPM 4.15 changed header returns from type 'bytes' to 'string'. Handle either + by converting to 'string' if necessary. (mmathesi) +- Don't expect module build tasks to have "rpms" (mulaieva) +- Propagate module_hotfixes to getMockConfig - rhbz#1780228 (lsedlar) +- Add check for wrong repo name format during clone - 353 (onosek) +- Simplify methods for getting namespace giturl (onosek) +- Use a single thread pool while watching module builds (csomh) +- Also capture stderr in logfile (orion) +- Line up descriptions for better code readability (onosek) +- Isolated container-build should allow arches override (rcerven) +- container-build: add --koji-parent-build argument (kdreyer) +- tests: add container-build --isolated test (kdreyer) +- container-build: add --isolated argument (kdreyer) +- Pass skip_build option to buildContainer (rcerven) +- Reuse koji_cli.lib.unique_path (cqi) + * Thu Jan 30 2020 Fedora Release Engineering - 1.59-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/sources b/sources index 9752728..39966a2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rpkg-1.59.tar.gz) = 773173f7133d65c8326649fac70c7f7ac32502f4cfe911d7d8988cad3892f0ea418aefa43c1a4a9a8ca68d1e020064d7c82a4e9d4e1a0c82ec9ace627bea3f20 +SHA512 (rpkg-1.60.tar.gz) = 7055653943b897e8223e2d352e691d6c7d2ce82c926e3cfefbaea3c6fc8f71284e3e894f51a083e3f6e13a71445ea8383f188c01e5ee19fb14432244d9df11f6