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: NEW --- 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: Triaged
Target Release: 9.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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.