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

<add> uses unsupported %patchN notation #16891

Open
IBBoard opened this issue Sep 25, 2024 · 0 comments
Open

<add> uses unsupported %patchN notation #16891

IBBoard opened this issue Sep 25, 2024 · 0 comments
Labels
Backend Things regarding the OBS backend Bug

Comments

@IBBoard
Copy link

IBBoard commented Sep 25, 2024

Issue Description

I am using a _link file with a <add> element to add a small patch to an upstream package.

Since yesterday, that package is no longer passing the build on the openbuildservice.org and it looks like OBS is using and outdated way of adding patches to RPM spec files.

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

The "badness" on that rule causes the termination of the packaging progress with the message Badness 10002 exceeds threshold 999, aborting after it completes the build and packaging. According to the package installations in the log, it was only using rpm-4.19.1.1-3.2, so it should have worked, despite the error.

Expected Result

OBS uses a modern patch insertion method for <add>. A build failure is not forced by linting rules.

How to Reproduce

  1. Run OBS with rpm-4.19 and rpmlint-mini-2.6.1+git20240918.5cb5647
  2. Create a new package with a _link file that links to another package with at least N patches
  3. Add <patches><add name="my-bug-fix.patch" after="N" popt="1"/></patches> inside the <link> (where N is the number of the patch that you want to run your patch after)
  4. Create a valid my-bug-fix.patch
  5. Wait for the build to complete
  6. Build completes but then gets force-failed by linting rules

Further Information

It looks like it's this bit of code that is responsible, but I don't know what other impact is of swapping %patch$nrx for %patch -P $nrx, and I can't test it on the public OBS server even if I did!

If I set after="0" then I don't get the "old format" error, but I get Patch number not specified instead. If I don't include the after attribute then it auto-generates a number and hits the same error as when I specify a number.

@danidoni danidoni added Bug Backend Things regarding the OBS backend labels Sep 27, 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