Bug 2161293 - `%patch 1` applies patches 0 and 1
Summary: `%patch 1` applies patches 0 and 1
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: rpm
Version: 9.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.3
Assignee: Packaging Maintenance Team
QA Contact: swm-qe
Mariya Pershina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-16 14:20 UTC by Vít Ondruch
Modified: 2023-07-31 07:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 2209 0 None open Document that `%patch 1` syntax is available and preferred 2023-01-16 14:20:17 UTC
Red Hat Issue Tracker RHELPLAN-145198 0 None None None 2023-01-16 14:20:51 UTC

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.


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