I don’t know where to find documentation for operator precedence in RPM
conditional expressions, but it looks like “!” binds more tightly than
“>=”, so
> %if ! 0%{?rhel} >= 8
is grouped as
> %if (! 0%{?rhel}) >= 8
which becomes, on Fedora:
> %if (! 00) >= 8
> %if 1 >= 8
and therefore evaluates false.
Writing
> %if ! (0%{?rhel} >= 8)
seems to do what you want, as would:
> %if 0%{?rhel} < 8
On 11/3/21 14:09, Sérgio Basto wrote:
Hi,
I just notice build in mock or koji this scriptlet [1] on a build for
Fedora gives me "is rhel 8 or 9" , what I'm missing ?
Thank you
[1]
%if ! 0%{?rhel} >= 8
echo "is not rhel >= 8"
%else
echo "is rhel 8 or 9"
%endif
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure