Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2161293

Summary: `%patch 1` applies patches 0 and 1
Product: Red Hat Enterprise Linux 9 Reporter: Vít Ondruch <vondruch>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED MIGRATED QA Contact: swm-qe
Severity: unspecified Docs Contact: Mariya Pershina <mpershin>
Priority: unspecified    
Version: 9.3CC: ffesti, jaruga, mbanas, mcurlej, mpershin, pmatilai
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 17:08:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vít Ondruch 2023-01-16 14:20:18 UTC
Description of problem:
rpm >= 4.18 supports new `%patch 1` syntax, while the older `%patch1` syntax is going to be deprecated. Is there a chance to support the `%patch 1` to speedup the adoption of the new syntax?



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
`%patch 1` is not supported


Expected results:
`%patch 1` is supported


Additional info:

Comment 1 Vít Ondruch 2023-01-16 14:21:25 UTC
Just FTR, I have reported this against RHEL8, but if that does not work, it would be better to address this at least in RHEL9.

Comment 2 Panu Matilainen 2023-01-17 14:54:29 UTC
It's too late for this kind of change in RHEL 8, but we'll consider for RHEL 9.

The main issue is compatibility, or lack of thereof, with some old quirky behaviors. Fedora/RHEL package set should not be affected but who knows what's out there...

Comment 4 Panu Matilainen 2023-01-17 15:15:25 UTC
Actually the story here is that rpm always supported patch numbers as positional arguments to %patch. 
The gotcha here is that %patch is *also* interpreted to mean either "patch number zero" or "numberless Patch:", depending on the rpm version, so '%patch 1' would try to apply patches 0 and 1. Which makes no sense whatsover, and could be considered as a bug. There problem is there may be people relying on '%patch' to apply patch 0/numberless patch.

This needs quite some care to avoid breaking and/or making the compat situation actually worse.

Comment 8 Jun Aruga 2023-05-17 08:35:05 UTC
> Bug 2161293 - `%patch 1` applies patches 0 and 1 

https://bugzilla.redhat.com/show_bug.cgi?id=2161293#c4
> The gotcha here is that %patch is *also* interpreted to mean either "patch number zero" or "numberless Patch:", depending on the rpm version, so '%patch 1' would try to apply patches 0 and 1. Which makes no sense whatsover, and could be considered as a bug. There problem is there may be people relying on '%patch' to apply patch 0/numberless patch.

The `%patch 1` try to apply "both" patch 0 and 1? Hmm, confusing.

Comment 12 RHEL Program Management 2023-09-21 16:27:55 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 13 RHEL Program Management 2023-09-21 17:08:16 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.