Bug 2283636 - Remove obsolete %patchN syntax from all spec files
Summary: Remove obsolete %patchN syntax from all spec files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: distribution
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Florian Festi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: RPM4.20
TreeView+ depends on / blocked
 
Reported: 2024-05-28 12:32 UTC by Florian Festi
Modified: 2024-07-09 17:59 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-09 16:54:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Florian Festi 2024-05-28 12:32:47 UTC
RPM has deprecated the %patchN syntax in favor of %patch -PN where N is the patch number for a year now. See the RPM documentation for more information [1]. In current RPM versions, this syntax only emits a deprecation warning, but support for this syntax has been removed completely in the upcoming RPM 4.20 release. As it will be added in Fedora soon [2] it is time to switch over to the new syntax in rawhide now.

There are around 1800 packages that still use the old syntax. Runnning this script [3] over the affected packages [4][5] updates them to the modern patch syntax. For example, the script will change:

%patch0 -p1 → %patch -P0 -p1
%patch0005 -p2 → %patch -P0005 -p2

As this change does not affect the resulting binary packages an
immediate rebuild is not needed. The change will "only" ensure the
packages still build with the new version of RPM.

This is the change with the highest compatibility (back to RPM 3.x). There are more modern options (like %patch N or switching to %autosetup completely) that packagers are encouraged to use.

The script also support -n to switch to the newer (only rpm >= 4.18) and cleaner syntax. 

[1] https://rpm-software-management.github.io/rpm/manual/spec.html#patch-1
[2] https://fedoraproject.org/wiki/Changes/RPM-4.20
[3] https://fedoraproject.org/wiki/File:User-Ffesti-new_patch_syntax.sh
[4] https://fedoraproject.org/wiki/File:User-Ffesti-patchNN-packages.txt
[5]
https://fedoraproject.org/wiki/File:User-Ffesti-patchNN-package-owners.txt

Reproducible: Always




The Following packages are treated differently:

Excluded:
 * dotnet6.0
 * dotnet7.0
 *

Using -n to switch to %patch N
 * Packages maintained by vondruch
 *

Comment 1 Miro Hrončok 2024-05-29 14:43:29 UTC
RPM 4.20 is in rawhide. Please make the change.

Comment 2 Fedora Update System 2024-07-09 15:13:40 UTC
FEDORA-2024-dfe107dd07 (gtorrentviewer-0.2b-54.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-dfe107dd07

Comment 3 Fedora Update System 2024-07-09 15:24:05 UTC
FEDORA-2024-dcd6b872a5 (milter-greylist-4.6.4-12.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-dcd6b872a5

Comment 4 Fedora Update System 2024-07-09 15:27:58 UTC
FEDORA-2024-65fba59be8 (perl-Archive-Any-Lite-0.11-26.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-65fba59be8

Comment 5 Fedora Update System 2024-07-09 16:50:36 UTC
FEDORA-2024-dbc927777d (perl-Convert-PEM-0.08-46.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-dbc927777d

Comment 6 Fedora Update System 2024-07-09 16:54:58 UTC
FEDORA-2024-dfe107dd07 (gtorrentviewer-0.2b-54.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2024-07-09 16:55:03 UTC
FEDORA-2024-dcd6b872a5 (milter-greylist-4.6.4-12.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2024-07-09 16:55:06 UTC
FEDORA-2024-65fba59be8 (perl-Archive-Any-Lite-0.11-26.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2024-07-09 16:55:20 UTC
FEDORA-2024-dbc927777d (perl-Convert-PEM-0.08-46.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2024-07-09 17:42:29 UTC
FEDORA-2024-c9b3a81c05 (perl-Crypt-DSA-1.17-41.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-c9b3a81c05

Comment 11 Fedora Update System 2024-07-09 17:43:32 UTC
FEDORA-2024-90de6f6a3e (perl-Module-Install-ReadmeFromPod-0.30-25.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-90de6f6a3e

Comment 12 Fedora Update System 2024-07-09 17:44:28 UTC
FEDORA-2024-c9b3a81c05 (perl-Crypt-DSA-1.17-41.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2024-07-09 17:47:28 UTC
FEDORA-2024-90de6f6a3e (perl-Module-Install-ReadmeFromPod-0.30-25.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2024-07-09 17:50:30 UTC
FEDORA-2024-a7b7185dce (perl-Readonly-2.05-25.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-a7b7185dce

Comment 15 Fedora Update System 2024-07-09 17:53:28 UTC
FEDORA-2024-a7b7185dce (perl-Readonly-2.05-25.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2024-07-09 17:56:33 UTC
FEDORA-2024-2ff5851e45 (perl-Test-utf8-1.02-14.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-2ff5851e45

Comment 17 Fedora Update System 2024-07-09 17:59:29 UTC
FEDORA-2024-2ff5851e45 (perl-Test-utf8-1.02-14.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


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