]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix specfile logic for disabling netcf
authorLaine Stump <laine@redhat.com>
Tue, 2 Feb 2021 17:51:48 +0000 (12:51 -0500)
committerLaine Stump <laine@redhat.com>
Wed, 3 Feb 2021 19:17:31 +0000 (14:17 -0500)
I *thought* I had tested all the combinations of manually setting
--without netcf, different versions of Fedora, etc, but apparently
not.

The check in libvirt.spec.in to see if the target was an older Fedora
or older RHEL would alway resolve to true, because, e.g., if {?fedora}
is undefined, then "0%{?fedora} < 34" is "0 < 34", which is always
true. Since both {?fedora} and {?rhel} are never defined at the same
time, the result of the entire expression is always true.

Fix this by qualifying each subexpression.

Fixes: 35d5b26aa433bd33f4b33be3dbb67313357f97f9
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
libvirt.spec.in

index 34b481c69e80016197d5280ce5ec4e6571e378d8..29b476184db2e873decf50217606db18ed42ef0f 100644 (file)
     %define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
 %endif
 
-%if 0%{?fedora} < 34 || 0%{?rhel} < 9
+%if (0%{?fedora} && 0%{?fedora} < 34) || (0%{?rhel} && 0%{?rhel} < 9)
     %define with_netcf 0%{!?_without_netcf:1}
 %endif