Hello Dominique, Am Donnerstag, 8. Februar 2024, 16:40:38 CET schrieb Dominique Leuenberger:
On Thu, 2024-02-08 at 16:16 +0100, Axel Braun wrote:
Hi, I need to patch a source file in the /usr/src of the build environment.
In absolute terms, this is in /var/tmp/build- root/openSUSE_Tumbleweed-x86_64/usr/src
It seems that %autosetup resp %patch0 work only in %{buildroot}, which is /var/tmp/build-root/openSUSE_Tumbleweed- x86_64/home/abuild/rpmbuild/BUILDROOT/
Any idea?
That sounds like something really bad to do for a package (and blocked by the fact that builds do not run as root)
Stuff that's been installed to /usr/src comes from a different package. If this needs patching, then I'd probably target that very package that installs the sources there. Isn't this an option? Would the patch harm there?
Its a workaround until https://bugzilla.opensuse.org/show_bug.cgi?id=1218423 is fixed. That would be the patch in the source package...
Alternaitvely, copy the stuff form /usr/src into the buildroot, patch it and make sure your build picks it up from there. Considering you're patching files from a different package though, the chance of it breaking is quite high.
Beside this, no idea how I make sure that the source inside the buildroot gets picked... Cheers Axel