rpmlint
rpmlint copied to clipboard
Add support for %autopatch/%apply_patch
Using %autopatch/%apply_patch [1], the patches are detected as not applied. It would be nice to provide support for this RPM feature.
Or even better, forcing %autosetup -p1 instead of %setup -q.
Can you please provide more context for this? I would like to implement it, but don't know what's expected?
This is mostly task for py2pack/pyp2rpm or stuff like that, but whenever I create new SPEC file I immediately change %setup -q to %autosetup -p1, because a) it is more convenient and it guarantees consistency of patches, b) what OP wrote here: it checks that there are no forgotten patches and all patches are ready to be applied. Thus I would argue %autopatch -p1/%autosetup -p1 makes better SPEC files and it is in the scope of rpmlint.
Thanks for the explanation. I tend to close this issue then.
I wrongly interpreted what @mcepl wrote, sorry.
I think we can close this one, the missing patch check is now there and there are a lot of tests, for example: https://github.com/rpm-software-management/rpmlint/blob/main/test/test_speccheck.py#L42-L44
And I've been testing and rpmlint detects when %autopatch is used, that could be the initial reported issue.
@marxin: There is an issue where
%patch -P1 -p1
Is not detected as applying Patch1, it is only detected as:
%patch -P 1 -p1
Example: %patch -P1 -p1 in https://download.copr.fedorainfracloud.org/results/bkaindl/uftrace/fedora-rawhide-x86_64/05749047-uftrace/uftrace.spec
Results in uftrace.spec: W: patch-not-applied Patch1: gethostbyname.patch in https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2180989-uftrace/fedora-rawhide-x86_64/05749104-uftrace/fedora-review/review.txt
The only difference is the space between -P and 1.