RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1834931 - rpm: add %autopatch min/max flags
Summary: rpm: add %autopatch min/max flags
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rpm
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.4
Assignee: Florian Festi
QA Contact: Eva Mrakova
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-12 17:10 UTC by Carl George 🤠
Modified: 2021-05-18 14:50 UTC (History)
5 users (show)

Fixed In Version: rpm-4.14.3-8.el8
Doc Type: Bug Fix
Doc Text:
.New `-m` and `-M` parameters are now supported for the `%autopatch` rpm macro With this update, the `-m` (min) and `-M` (max) parameters have been added to the `%autopatch` macro to apply only a range of patches with given parameters.
Clone Of:
Environment:
Last Closed: 2021-05-18 14:49:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)

Description Carl George 🤠 2020-05-12 17:10:02 UTC
Description of problem:
RPM 4.15 adds the -m and -M flags to the %autopatch macro to allow specifying minimum and maximum patch numbers to apply [0].  This is broadly useful, but also brings specific benefits to CentOS as we work to incorporate our debranding as conditionals in RHEL spec files.  For example, gnome-settings-daemon includes a subscription manager plugin.  Disabling that requires skipping several patches.  Currently our only option is to apply the patches individually.

%patch00001 -p 1
%patch00002 -p 1
%patch00003 -p 1
%patch00004 -p 1
%patch00005 -p 1
%patch00006 -p 1
%patch10001 -p 1
%if %{with subman}
%patch10002 -p 1
%patch10003 -p 1
%patch10004 -p 1
%endif

Backporting the min/max flags would allow this to be much cleaner, as well as reducing errors when adding and removing patches in the future.

%autopatch -p 1 -M 10001
%if %{with subman}
%autopatch -p 1 -m 10002 -M 10004
%endif

Please consider backporting the upstream commit [1] to the RHEL 8 rpm package.


Version-Release number of selected component (if applicable):
rpm-4.14.2-37.el8


Additional info:
[0]: https://rpm.org/wiki/Releases/4.15.0#macros
[1]: https://github.com/rpm-software-management/rpm/commit/f00bb5be9caa62220c6aeaf3f7264840d5c089e3

Comment 17 errata-xmlrpc 2021-05-18 14:49:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rpm bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1606


Note You need to log in before you can comment on or make changes to this bug.