[Rpm-maint] [rpm-software-management/rpm] Allow to specify a default for bcond features in a macro file (PR #2405)
Tomasz Kłoczko
notifications at github.com
Wed Jan 31 12:40:52 UTC 2024
This PR is wrong and is not solving th issue.
It is the problem that macros used with `%bcond_with foo`/`%bcond_without foo` like `%{?with_foo}` and `%{?without_foo}` are using presence or not that macro.
If you will look closer on macros file
```spec
# Internally, the `--with foo` option defines the macro `_with_foo` and the
# `--without foo` option defines the macro `_without_foo`.
# Based on those and a default (used when neither is given), bcond macros
# define the macro `with_foo`, which should later be checked:
%bcond() %[ (%2)\
? "%{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}"\
: "%{expand:%%{?_with_%{1}:%%global with_%{1} 1}}"\
]
%bcond_with() %bcond %{1} 0
%bcond_without() %bcond %{1} 1
# Shorthands for %{defined with_...}:
%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
```
you can find that it is used only presence of `%{with_foo}` or not.
This is why I have issue with disable globally %check using %bcond https://github.com/rpm-software-management/rpm/discussions/2870
Please test you PR with test spec and test units which I've added in this discussion and you will find that you PR is not working as expected/
IMO better would be leave %bcond as it is ad define possibility to use something new.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2405#issuecomment-1919030097
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2405/c1919030097 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240131/26a3dd95/attachment.html>
More information about the Rpm-maint
mailing list