On Tue, May 10, 2022 at 12:28 PM Vitaly Zaitsev via devel devel@lists.fedoraproject.org wrote:
On 10/05/2022 18:00, Ben Beasley wrote:
Could you please elaborate on why this form is better?
For building on RHEL without EPEL being enabled.
At minimum, “%if 0%{?rhel} && 0%{?rhel} == 8” is exactly equivalent to “%if 0%{?rhel} == 8”.
Double checks are preferable, because "%if 0%{?rhel} < X" can easily break things.
For example, on Fedora the %{?rhel} macro is not defined, so the condition 0%{?rhel} < 9 will be true because 0 is less than 9.
So what? If you're checking:
%if 0%{?rhel} == 8
There's no need for the double check. If you were looking for RHEL < 8, yeah, it could make sense
%if 0%{?rhel} && 0%{?rhel} < 8