Replies: 1 comment
-
|
It seems like Build conditionals also support distro-wide overrides, which I initially thought was what you were looking for, except it's probably not relevant here. Anyway, here's the docs: https://rpm.org/docs/4.20.x/manual/conditionalbuilds.html#overriding-defaults |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to define a logic like
where it should behave like:
%bcondand no--with/--withoutare defined use the default value provided%bcondand--with/--withoutare provided, use the values overrided%bcondis defined, ignore any--with/--withoutvalues and use a default valueWith the current implementation, the first 2 points are available out-of-the-box without even needing to negate the check. But the last point is the part that I am having trouble implementing because
%{without ctest}will always evaluate to0rpm/macros.in
Lines 79 to 98 in 5f27041
Using
%with_ctestor%_without_ctestdirectly was not fruitful either. One issue is that%with_*always has value1, instead of using the default value and being overwritten by the--withoutflag, i.e. with the following :%bcond() %[ %{__bcond_override_default %{1} %{2}}\ - ? "%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}"\ - : "%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}"\ + ? %[ "%{expand:%%{?_without_%{1}}" ? "%{expand:%%global with_%{1} 0}" : "%{expand:%%global with_%{1} 1}" ]\ + ? %[ "%{expand:%%{?_with_%{1}}" ? "%{expand:%%global with_%{1} 1}" : "%{expand:%%global with_%{1} 0}" ]\ ]I would be able to use
%{?with_ctest:<my_default>}. There probably was some discussion on this design and I am curious if the current design is due to some backwards compatibility issue?Alternatively, if whenever
%bcondis called, it would save a%global bcond_defined_<name>than that could also be interrogated and move that check in the initial%ifstatement that I want to use.Beta Was this translation helpful? Give feedback.
All reactions