public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Patch: Add mock configuration option to build and srpm
Date: Mon, 10 Aug 2026 21:44:49 GMT [thread overview]
Message-ID: <178639828906.1.3960651299514581684.rpms-rpkg-c61ad3724f01@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rpkg
Branch : 1.70-1
Commit : c61ad3724f01d5c172fda5dc777bdf3c9fa1fee2
Author : Ondřej Nosek <onosek@redhat.com>
Date : 2025-09-12T10:18:34+00:00
Stats : +102/-5 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpkg/c/c61ad3724f01d5c172fda5dc777bdf3c9fa1fee2?branch=1.70-1
Log:
Patch: Add mock configuration option to build and srpm
Signed-off-by: Ondřej Nosek <onosek@redhat.com>
---
diff --git a/0008-Add-mock-configuration-option-to-build-and-srpm.patch b/0008-Add-mock-configuration-option-to-build-and-srpm.patch
new file mode 100644
index 0000000..30a7fc5
--- /dev/null
+++ b/0008-Add-mock-configuration-option-to-build-and-srpm.patch
@@ -0,0 +1,95 @@
+From 041be8edebc59eb5606f80987d8e74fe1bf2099f Mon Sep 17 00:00:00 2001
+From: Anton Bobrov <abobrov@redhat.com>
+Date: Wed, 13 Aug 2025 10:04:33 +0200
+Subject: [PATCH] Add mock configuration option to build and srpm commands for
+ use along with the srpm mock option, same as in mockbuild command.
+
+Add arguments separator for mock rpm shell in
+load_nameverrel_mock to ensure the rpm args go to
+rpm and not mock.
+
+Signed-off-by: Anton Bobrov <abobrov@redhat.com>
+---
+ pyrpkg/__init__.py | 2 +-
+ pyrpkg/cli.py | 17 +++++++++++++----
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 41a84c2..a4e8b23 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -842,7 +842,7 @@ class Commands(object):
+ "--specfile", "%s" % os.path.join(tmp_root, self.spec)])
+ # escape whole 'rpm' command because it will be executed under mock command
+ rpm_cmd = [shlex.quote(item) for item in rpm_cmd]
+- main_cmd = cmd + ['--shell'] + rpm_cmd \
++ main_cmd = cmd + ['--shell'] + ['--'] + rpm_cmd \
+ + ['> ' + os.path.join(tmp_root, 'output')]
+
+ copyout_cmd = cmd + ['--copyout', os.path.join(tmp_root, 'output'), tmp_resultdir]
+diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
+index 9fbb166..decef3f 100644
+--- a/pyrpkg/cli.py
++++ b/pyrpkg/cli.py
+@@ -569,6 +569,9 @@ class cliClient(object):
+ '--srpm-mock', action='store_true',
+ help='Build from an srpm. Source rpm will be generated in \'mock\''
+ ' instead of \'rpmbuild\'.')
++ build_parser.add_argument(
++ '--root', '--mock-config', '-r', metavar='CONFIG',
++ dest='root', help='Override mock configuration (like mock -r)')
+ build_parser.set_defaults(command=self.build)
+
+ def register_chainbuild(self):
+@@ -1522,6 +1525,9 @@ class cliClient(object):
+ '--srpm-mock', action='store_true',
+ help='Build from an srpm. Source rpm will be generated in \'mock\''
+ ' instead of \'rpmbuild\'.')
++ scratch_build_parser.add_argument(
++ '--root', '--mock-config', '-r', metavar='CONFIG',
++ dest='root', help='Override mock configuration (like mock -r)')
+ scratch_build_parser.set_defaults(command=self.scratch_build)
+
+ def register_sources(self):
+@@ -1585,6 +1591,9 @@ class cliClient(object):
+ srpm_parser.add_argument(
+ '--offline', dest='koji_offline', help='Don\'t connect to the Koji '
+ 'and try to work offline', action='store_true')
++ srpm_parser.add_argument(
++ '--root', '--mock-config', '-r', metavar='CONFIG',
++ dest='root', help='Override mock configuration (like mock -r)')
+ srpm_parser.set_defaults(command=self.srpm)
+
+ def register_copr_build(self):
+@@ -1967,12 +1976,12 @@ class cliClient(object):
+ if hasattr(self.args, 'srpm_mock') and self.args.srpm_mock:
+ # Set the release and version of a package with mock. Mockbuild needs them.
+ self.cmd.load_nameverrel_mock(mockargs=tuple(),
+- root=None,
++ root=self.args.root,
+ force_local_mock_config=None)
+ # generate srpm with mock instead of rpmbuild
+ self.log.debug('Generating an srpm with mock')
+ self.cmd.mockbuild(mockargs=tuple(),
+- root=None,
++ root=self.args.root,
+ hashtype=self.args.hash,
+ shell=None,
+ force_local_mock_config=None,
+@@ -3011,11 +3020,11 @@ class cliClient(object):
+
+ # Set the release and version of a package with mock. Mockbuild needs them.
+ self.cmd.load_nameverrel_mock(mockargs=tuple(),
+- root=None,
++ root=self.args.root,
+ force_local_mock_config=None)
+ # generate srpm with mock instead of rpmbuild
+ self.cmd.mockbuild(mockargs=tuple(),
+- root=None,
++ root=self.args.root,
+ hashtype=self.args.hash,
+ shell=None,
+ force_local_mock_config=None,
+--
+2.51.0
+
diff --git a/rpkg.spec b/rpkg.spec
index 70e68de..8b1ee3f 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
Name: rpkg
Version: 1.68
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Python library for interacting with rpm+git
# Automatically converted from old format: GPLv2+ and LGPLv2 - review is highly recommended.
@@ -27,10 +27,8 @@ Source0: https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz
# hatchling is supported in >Python 3.6 releases (RHEL 8)
%if 0%{?rhel} && 0%{?rhel} <= 8
%global with_hatchling 0
-%{echo:--> with_hatchling unset, 0%{?rhel} %{?fedora}}
%else
%global with_hatchling 1
-%{echo:--> with_hatchling set, 0%{?rhel} %{?fedora}}
%endif
@@ -54,6 +52,7 @@ Patch4: 0004-patch-Execute-subprocess-in-text-mode.patch
Patch5: 0005-type-fix-typo-in-requirements-README.patch
Patch6: 0006-install-add-rpmbuild-arguments-with-and-without.patch
Patch7: 0007-srpm-man-page-generation-fixed.patch
+Patch8: 0008-Add-mock-configuration-option-to-build-and-srpm.patch
%description
Python library for interacting with rpm+git
@@ -284,6 +283,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
%changelog
+* Thu Sep 11 2025 Ondřej Nosek <onosek@redhat.com> - 1.68-7
+- Patch: Add mock configuration option to build and srpm
+
* Tue Sep 02 2025 Ondřej Nosek <onosek@redhat.com> - 1.68-6
- Patch: `pre-push-check`: bogus error - file wasn't listed
- Patch: Fix mockbuild --srpm-mock specfile_path
@@ -615,14 +617,14 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
- Add --offline cli argument for new-sources (oturpe)
- Tests: Fix setting branch name with old git (nils)
- Add and augment tests for rpmautospec (nils)
-- Reflect %autorelease when parsing spec files (nils)
+- Reflect %%autorelease when parsing spec files (nils)
- Preprocess spec files using rpmautospec features (nils)
- Detect generic use of rpmautospec features (nils)
- Fix remaining Python3 SafeConfigParser warnings (nils)
- Tests: specify branch name on `git init` (nils)
- Remove leftover deprecated arguments (abisoi)
- Remove deprecated arguments --dist and --module-name (abisoi)
-- Skip NVR check if the %autorelease macro is used - 109 (nils)
+- Skip NVR check if the %%autorelease macro is used - 109 (nils)
- Don't access unset variable (nils)
- Improve help in fedpkg clone command - #367 (abisoi)
- Fix rpkg container-build ignoring values when same argument is specified
reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=178639828906.1.3960651299514581684.rpms-rpkg-c61ad3724f01@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