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

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : 30368f20cf85f80c2396e9ff0ec3b11837a67558
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2024-12-10T02:24:17+00:00
            Stats  : +199/-1 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/30368f20cf85f80c2396e9ff0ec3b11837a67558?branch=1.70-1

            Log:
            A few patches:

- Patch: `chain-build`: correct the info message
- Patch: Fix regular expression for parsing Source lines
- Patch: Add draft builds support

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

---
diff --git a/0006-Add-draft-builds-support.patch b/0006-Add-draft-builds-support.patch
new file mode 100644
index 0000000..9eb57fb
--- /dev/null
+++ b/0006-Add-draft-builds-support.patch
@@ -0,0 +1,98 @@
+From 53a12c6fea813598851af65390695a69c8f29b76 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Nosek?= <onosek@redhat.com>
+Date: Wed, 9 Oct 2024 03:24:51 +0200
+Subject: [PATCH 1/3] Add draft builds support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Generally, it means adding `--draft` argument to the koji build
+command.
+
+JIRA: RHELCMP-14108
+
+Signed-off-by: Ondřej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py |  6 +++++-
+ pyrpkg/cli.py      | 11 +++++++++--
+ 2 files changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 573fc36..c3e1722 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -2456,7 +2456,7 @@ class Commands(object):
+ 
+     def build(self, skip_tag=False, scratch=False, background=False,
+               url=None, chain=None, arches=None, sets=False, nvr_check=True,
+-              fail_fast=False, custom_user_metadata=None):
++              fail_fast=False, custom_user_metadata=None, draft=False):
+         """Initiate a build in build system
+ 
+         :param bool skip_tag: Skip the tag action after the build.
+@@ -2473,6 +2473,7 @@ class Commands(object):
+             will cause the entire build to fail if any subtask/architecture
+             build fails.
+         :param str custom_user_metadata: JSON string of custom metadata
++        :param bool draft: Perform a draft build. Default is False.
+         :return: task ID returned from Koji API ``build`` and ``chainBuild``.
+         :rtype: int
+         """
+@@ -2524,6 +2525,9 @@ class Commands(object):
+         if scratch:
+             opts['scratch'] = True
+             cmd.append('--scratch')
++        if draft:
++            opts['draft'] = True
++            cmd.append('--draft')
+         if background:
+             cmd.append('--background')
+             priority = 5  # magic koji number :/
+diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
+index 97c2904..bf2cfa1 100644
+--- a/pyrpkg/cli.py
++++ b/pyrpkg/cli.py
+@@ -548,9 +548,13 @@ class cliClient(object):
+         build_parser.add_argument(
+             '--skip-tag', action='store_true', default=False,
+             help='Do not attempt to tag package')
+-        build_parser.add_argument(
++        build_type_group = build_parser.add_mutually_exclusive_group()
++        build_type_group.add_argument(
+             '--scratch', action='store_true', default=False,
+             help='Perform a scratch build')
++        build_type_group.add_argument(
++            '--draft', action='store_true', default=False,
++            help='Perform a draft build')
+         build_parser.add_argument(
+             '--srpm', nargs='?', const='CONSTRUCT',
+             help='Build from an srpm. If no srpm is provided with this option'
+@@ -2125,7 +2129,8 @@ class cliClient(object):
+             sets=sets,
+             nvr_check=nvr_check,
+             fail_fast=self.args.fail_fast,
+-            custom_user_metadata=custom_user_metadata)
++            custom_user_metadata=custom_user_metadata,
++            draft=self.args.draft)
+ 
+     def chainbuild(self):
+         """Implement chain-build command"""
+@@ -2176,6 +2181,7 @@ class cliClient(object):
+         self.args.chain = urls
+         self.args.skip_tag = False
+         self.args.scratch = False
++        self.args.draft = False
+         return self.build(sets)
+ 
+     def clean(self):
+@@ -2936,6 +2942,7 @@ class cliClient(object):
+         # A scratch build is just a build with --scratch
+         self.args.scratch = True
+         self.args.skip_tag = False
++        self.args.draft = False
+         return self.build()
+ 
+     def sources(self):
+-- 
+2.47.1
+

diff --git a/0007-Fix-regular-expression-for-parsing-Source-lines.patch b/0007-Fix-regular-expression-for-parsing-Source-lines.patch
new file mode 100644
index 0000000..d6301c8
--- /dev/null
+++ b/0007-Fix-regular-expression-for-parsing-Source-lines.patch
@@ -0,0 +1,54 @@
+From 2a9507f1882bc6dbcf49f9dd39cbff451d41f1c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Nosek?= <onosek@redhat.com>
+Date: Mon, 14 Oct 2024 01:39:42 +0200
+Subject: [PATCH 2/3] Fix regular expression for parsing Source lines
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When pushing changes to the dist-git repo, the `pre-push-check`
+didn't identify hidden files (.file) among 'SourceX|PatchX'
+definitions. The regular expression was taken from another part
+of the code and improved.
+
+Fixes: #721
+JIRA: RHELCMP-13881
+
+Signed-off-by: Ondřej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py | 5 +++--
+ pyrpkg/spec.py     | 2 +-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index c3e1722..fd953b3 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -4575,8 +4575,9 @@ class Commands(object):
+         source_files = []
+         # extract source files from the spectool's output
+         for line in stdout.split('\n'):
+-            file_location = re.sub(r'(?:Source|Patch)\d+\s*:\s*(\w+)', r'\1', line, re.IGNORECASE)
+-            if file_location:
++            match = SpecFile.sourcefile_expression.match(line)
++            if match:
++                file_location = match.group('val')
+                 # find out the format of the source file path. From URL use just the file name.
+                 # We want to keep hierarchy of the files if possible
+                 res = urllib.parse.urlparse(file_location)
+diff --git a/pyrpkg/spec.py b/pyrpkg/spec.py
+index 5400de3..28e3a27 100644
+--- a/pyrpkg/spec.py
++++ b/pyrpkg/spec.py
+@@ -15,7 +15,7 @@ from pyrpkg.errors import rpkgError
+ class SpecFile(object):
+     """Simple specfile parser that finds source file names"""
+     sourcefile_expression = re.compile(
+-        r'^((source[0-9]*|patch[0-9]*)\s*:\s*(?P<val>.*))\s*$',
++        r'^(?:Source|Patch)\d*\s*:\s*(?P<val>[^\s]+)\s*$',
+         re.IGNORECASE)
+ 
+     def __init__(self, spec, rpmdefines):
+-- 
+2.47.1
+

diff --git a/0008-chain-build-correct-the-info-message.patch b/0008-chain-build-correct-the-info-message.patch
new file mode 100644
index 0000000..89119a7
--- /dev/null
+++ b/0008-chain-build-correct-the-info-message.patch
@@ -0,0 +1,38 @@
+From f3cbcdd3b08311755940cb23dae131bbed901f9c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ond=C5=99ej=20Nosek?= <onosek@redhat.com>
+Date: Wed, 16 Oct 2024 02:57:52 +0200
+Subject: [PATCH 3/3] `chain-build`: correct the info message
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The info message was missing the whole 'chain' which says what
+components will be built. Originally, it didn't contain the last
+group of components. It was confusing for users.
+
+Fixes: https://pagure.io/fedpkg/issue/567
+JIRA: RHELCMP-14076
+
+Signed-off-by: Ondřej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index fd953b3..dfccad3 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -2596,8 +2596,8 @@ class Commands(object):
+             cmd.extend(' : '.join(
+                 [' '.join(build_sets) for build_sets in chain]
+             ).split())
+-            self.log.info('Chain building %s + %s for %s',
+-                          build_reference, chain[:-1], self.target)
++            self.log.info('Chain building %s, chain consists of %s, for %s',
++                          build_reference, chain, self.target)
+             self.log.debug(
+                 'Building chain %s for %s with options %s and a priority '
+                 'of %s', chain, self.target, opts, priority)
+-- 
+2.47.1
+

diff --git a/rpkg.spec b/rpkg.spec
index c956f52..f15df43 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.67
-Release:        4%{?dist}
+Release:        5%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 # Automatically converted from old format: GPLv2+ and LGPLv2 - review is highly recommended.
@@ -47,6 +47,9 @@ Patch3:         0003-Remove-Environment-Markers-syntax.patch
 %endif
 Patch4:         0004-Fix-package-in-Pypi.patch
 Patch5:         0005-Fixing-encoding-of-the-url-when-checking-lookaside.patch
+Patch6:         0006-Add-draft-builds-support.patch
+Patch7:         0007-Fix-regular-expression-for-parsing-Source-lines.patch
+Patch8:         0008-chain-build-correct-the-info-message.patch
 
 
 %description
@@ -278,6 +281,11 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
 
 
 %changelog
+* Tue Dec 10 2024 Ondřej Nosek <onosek@redhat.com> - 1.67-5
+- Patch: `chain-build`: correct the info message
+- Patch: Fix regular expression for parsing Source lines
+- Patch: Add draft builds support
+
 * Mon Sep 16 2024 Ondřej Nosek <onosek@redhat.com> - 1.67-4
 - Patch: Fixing encoding of the url when checking lookaside
 - Patch: Fix package in Pypi

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 21:44  [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-10 21:44 [rpms/rpkg] 1.70-1: A few patches: 
2026-08-10 21:44 
2026-08-10 21:44 
2026-08-10 21:44 
2026-08-10 21:44 

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=178639828493.1.12380808644460281051.rpms-rpkg-30368f20cf85@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