Get rid of all %patchN usage

Fixes https://pagure.io/packaging-committee/issue/1442
This commit is contained in:
Miro Hrončok 2025-03-28 22:43:20 +01:00
commit 224d8554c5
4 changed files with 9 additions and 10 deletions

View file

@ -123,10 +123,10 @@ Some things to watch out for:
....
%prep
%setup -qc
%autosetup -N -c
mv %{srcname}-%{version} python2
pushd python2
%patch0 -p1 -b .testfix
%autopatch -p1
find -name '*.txt' | xargs chmod -x
# copy common doc files to top dir

View file

@ -283,11 +283,9 @@ A sample spec for building gems would look like this:
....
%prep
%setup -q -n %{gem_name}-%{version}
%autosetup -p1 -n %{gem_name}-%{version}
# Modify the gemspec if necessary
# Also apply patches to code if necessary
%patch0 -p1
%build
# Create the gem as gem install only works on a gem file

View file

@ -319,12 +319,13 @@ Patch1: oldpatch.patch
Patch2: ngpatch.patch
...
%prep
%autosetup -N
...
%if 0%{?fedora} < 35
tar xf %{SOURCE1}
%patch1 -p1
%patch 1 -p1
%else
tar xf %{SOURCE2}
%patch2 -p1
%patch 2 -p1
%endif
```

View file

@ -494,7 +494,7 @@ from being used to apply patches
when some of those patches apply only to certain architectures.
The best solution is to write patches
which simply work on all architectures.
If that is not possible, then simply use `+%setup+`
If that is not possible, then simply use `+%autosetup -N+`
and to use the `+%patch+` macro to apply each patch
using `+%ifarch+` or `+%ifnarch+` as appropriate.
For example:
@ -502,9 +502,9 @@ For example:
[source, rpm-spec]
----
%prep
%setup -q
%autosetup -N
%ifarch s390x
%patch0 -p1
%patch 0 -p1
%endif
----