Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link patches are applied with deprecated rpm macro, builds fail #17127

Open
pallaswept opened this issue Nov 25, 2024 · 1 comment
Open

link patches are applied with deprecated rpm macro, builds fail #17127

pallaswept opened this issue Nov 25, 2024 · 1 comment
Labels
Backend Things regarding the OBS backend Bug

Comments

@pallaswept
Copy link

Issue Description

I created a link to an existing package, and edited the resulting _link file to add a patch
The patch was successfully added, the package built successfully, however the linter failed the build:

[   40s] 
[   40s] pam_ssh_agent_auth.spec:56: E: patch-macro-old-format (Badness: 10000)
[   40s] The usage of %patchN is not supported by RPM >= 4.20. The preferred way to
[   40s] apply patches are, in order:  * %autosetup -p1  * %autosetup -N / %autopatch
[   40s] -p1  * %setup / %patch -P <N> -p 1 (upper case P denotes patch number,
[   40s] lower case is the usual patch -p<num> strip level)
[   40s] 

Expected Result

Build completes without linter error

How to Reproduce

  1. create a link to an existing package with osc linkpac
  2. edit the resulting _link file to add a patch eg <add name="add-argument-default_ssh_auth_sock-and-some-fixes.patch" popt="1"/>
  3. commit the changes to build the package
  4. See error
@pallaswept
Copy link
Author

Not sure if I should be submitting a PR, but hopefully it helps: pretty sure these two lines just need to be slightly altered, to use the new macros

print O "%patch$nrx -p$p->{'popt'}\n";

print O "%patch$nrx\n";

ie just change
%patch$nrx
to
%patch -P $nrx

@rubhanazeem rubhanazeem added Bug Backend Things regarding the OBS backend labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Things regarding the OBS backend Bug
Projects
None yet
Development

No branches or pull requests

2 participants