public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Some patches
Date: Mon, 10 Aug 2026 21:44:10 GMT	[thread overview]
Message-ID: <178639825087.1.14833107458474157824.rpms-rpkg-e6213fcfa3ba@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : e6213fcfa3ba1fc76757d10a4941e102345c29e1
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2020-01-02T13:33:50+00:00
            Stats  : +218/-1 in 5 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/e6213fcfa3ba1fc76757d10a4941e102345c29e1?branch=1.70-1

            Log:
            Some patches

- Propagate module_hotfixes to getMockConfig
- Don't expect module build tasks to have "rpms"
- RPM 4.15 changed header - type conversion
- Create stats for module builds in 'init' state

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0008-Propagate-module_hotfixes-to-getMockConfig.patch b/0008-Propagate-module_hotfixes-to-getMockConfig.patch
new file mode 100644
index 0000000..10f0aca
--- /dev/null
+++ b/0008-Propagate-module_hotfixes-to-getMockConfig.patch
@@ -0,0 +1,62 @@
+From cf8d67db902203d18e86378632e22454deb960b4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
+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ář <lsedlar@redhat.com>
+---
+ 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
new file mode 100644
index 0000000..9f7c0a2
--- /dev/null
+++ b/0009-Don-t-expect-module-build-tasks-to-have-rpms.patch
@@ -0,0 +1,45 @@
+From 02affb458224f39eb4593cfba8dead8d2faa5084 Mon Sep 17 00:00:00 2001
+From: Mariana Ulaieva <mulaieva@redhat.com>
+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 <mulaieva@redhat.com>
+---
+ 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
new file mode 100644
index 0000000..64e9553
--- /dev/null
+++ b/0010-RPM-4.15-changed-header-returns-from-type-bytes-to-s.patch
@@ -0,0 +1,48 @@
+From fdc40f7be78e120f6b880d352cc916f39d36477f Mon Sep 17 00:00:00 2001
+From: Merlin Mathesius <mmathesi@redhat.com>
+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 <mmathesi@redhat.com>
+---
+ 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
new file mode 100644
index 0000000..152d286
--- /dev/null
+++ b/0011-Create-stats-for-module-builds-in-init-state.patch
@@ -0,0 +1,51 @@
+From 5cce3d5957afd757fb4b4cebacb6d7f72510d78d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hunor=20Csomort=C3=A1ni?= <csomh@redhat.com>
+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 <csomh@redhat.com>
+
+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 8bc3e2c..6c53a29 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.59
-Release:        4%{?dist}
+Release:        5%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -24,6 +24,10 @@ 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
 
 %if 0%{?fedora} || 0%{?rhel} > 7
 # Enable python3 build by default
@@ -277,6 +281,13 @@ nosetests tests
 
 
 %changelog
+* Thu Jan 02 2020 Ondřej Nosek <onosek@redhat.com> - 1.59-5
+- Some patches:
+- Propagate module_hotfixes to getMockConfig
+- Don't expect module build tasks to have "rpms"
+- RPM 4.15 changed header - type conversion
+- Create stats for module builds in 'init' state
+
 * Tue Dec 03 2019 Ondřej Nosek <onosek@redhat.com> - 1.59-4
 - Patch: limited thread pool for watching module builds
 

             reply	other threads:[~2026-08-10 21:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 21:44  [this message]
2026-08-10 21:44 [rpms/rpkg] 1.70-1: Some patches 

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178639825087.1.14833107458474157824.rpms-rpkg-e6213fcfa3ba@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox