[opensuse-buildservice] Substitute is only partially applied
Substitute: in prjconf is applied to BuildRequires, and the changes appear in the pkg.spec file. But it is only partly applied to Requires(pre|post). The "solver" uses the replaced strings, but they are not applied to the pkg.spec. As a result the binary package can not be installed because it still requires the string that was supposed to be replaced by Substitute. Is that done intentional, or is it a bug? Olaf
On Dez 12 2017, Olaf Hering
Substitute: in prjconf is applied to BuildRequires, and the changes appear in the pkg.spec file. But it is only partly applied to Requires(pre|post). The "solver" uses the replaced strings, but they are not applied to the pkg.spec. As a result the binary package can not be installed because it still requires the string that was supposed to be replaced by Substitute.
Is that done intentional, or is it a bug?
It's intentional, Substitute is only for building. Requires etc. are not evaluated during build, only during install. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Wed, Dec 13, 2017 at 08:57:09AM +0100, Olaf Hering wrote:
On Tue, Dec 12, Olaf Hering wrote:
Is that done intentional, or is it a bug?
Looks like a bug. Requires are replaced, PreReq and Requires(post|pre) are not replaced.
Yes, that's a bug. The code is from 2007, so it's no surprise that Requires(pre|post) is not understood. The whold substitutes mechanism has gone a bit out of fashion, so I'm wondering how you're using it. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Wed, Dec 13, Michael Schroeder wrote:
The whold substitutes mechanism has gone a bit out of fashion, so I'm wondering how you're using it.
What do you mean "how I'm using it"? Also not sure how it is oldfashioned. Polluting specfiles with %if suse_version cant be the goal. The specific case that triggered this mail was: %if 0%{?suse_version} == 1315 Substitute: hostname net-tools The Leap package is supposed to depend on net-tools. The current usage of "hostname" installs both hostname+net-tools, which leads to fileconflicts during buildroot setup. Building works fine, but the Leap/SLE pkg still requires the unavailable hostname.rpm. Substitute is used alot already to replace pkgconfig() with expanded pkg names, or replace one devel pkg with another: %if 0%{?suse_version} == 1315 Substitute: pkgconfig(freeglut) freeglut-devel= # Development happens for Tumbleweed Substitute: libboost_atomic-devel boost-devel= Or I just wipe some string, but this leads to empty strings in some cases, which breaks build (in the first example): %if 0%{?sle_version} == 120300 # Leap 42.3 Substitute: group(audio) Substitute: pkgconfig(wayland-egl) Olaf
participants (3)
-
Andreas Schwab
-
Michael Schroeder
-
Olaf Hering