Hello! Now I have "positive" construction: %if ( 0%{?sles_version} > 120200 && !0%{?is_opensuse} ) || ( 0%{?sles_version} > 120200 && 0%{?is_opensuse} ) || 0%{?rhel_version}
600 || 0%{?centos_version} > 600 || 0%{?scientificlinux_version} > 600 %doc README.md %license LICENSE LICENSE.GPL2 %else %doc LICENSE LICENSE.GPL2 README.md %endif
or even %if ( 0%{?sles_version} >= 120300 && !0%{?is_opensuse} ) || ( 0%{?sles_version} >= 120300 && 0%{?is_opensuse} ) || 0%{?rhel_version}
= 700 || 0%{?centos_version} >= 700 || 0%{?scientificlinux_version} >= 700 %doc README.md %license LICENSE LICENSE.GPL2 %else %doc LICENSE LICENSE.GPL2 README.md %endif
And... these all also don't work: on openSUSE 42.3 LICENSE LICENSE.GPL2 files are still in /usr/share/doc/ instead of /usr/share/licenses/ . o_O Any ideas, please? If construction is OK ("positive"), OS detection is OK (due to guidelines) -- why this doesn't work correctly... вт, 6 нояб. 2018 г. в 11:19, Andreas Schwab <schwab@suse.de>:
On Nov 06 2018, Mikhail Kasimov <mikhail.kasimov@gmail.com> wrote:
%if ( 0%{?sles_version} < 120300 && !0%{?is_opensuse} ) || ( 0%{?sles_version} < 120300 && 0%{?is_opensuse} ) || 0%{?rhel_version} < 700 || 0%{?centos_version} < 700 || 0%{?scientificlinux_version} < 700
This condition is true if any of the version macros is undefined. It is generally better to formulate positive conditions on version macros. I.e., instead of checking for 0%{?foo_version} < x, reverse the condition and check for 0%{?foo_version} > y.
Andreas.
-- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org