From d27d39a4b0be2e1bfa280ae7b713419ab6b796f2 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Mar 24 2018 10:04:30 +0000 Subject: Add more exceptions to modifier --- diff --git a/fixrequires/modifier.py b/fixrequires/modifier.py index 736ab69..2eb2008 100644 --- a/fixrequires/modifier.py +++ b/fixrequires/modifier.py @@ -66,7 +66,10 @@ R_IGNORE_IN_CLAUSES = ( '%if 0%{?rhel} >= 7', '%if (0%{?fedora} && 0%{?fedora} <= 25) || (0%{?rhel} && 0%{?rhel} <= 7)', '%if 0%{?rhel} < 7', + '%if 0%{?rhel} <= 7', '%if 0%{?el6}%{?el7}', + '%elseif 0%{?el6}', + '%if 0%{?rhel} || 0%{?fedora} < 23', ) R_ELSE_CLAUSES = [elem + '%else' for elem in R_IGNORE_IN_CLAUSES] @@ -112,7 +115,8 @@ F_IGNORE_ELSE_CLAUSES = ( '%if 0%{?with_explicit_python27}%else', '%if 0%{?fedora} >= 24%else', '%if 0%{?fedora} || 0%{?rhel} > 6%else', - '%if ( 0%{?fedora} && 0%{?fedora} >= 28 )%else' + '%if ( 0%{?fedora} && 0%{?fedora} >= 28 )%else', + '%if 0%{?fedora} > 18%else' ) REQUIRES_PATTERN = '#?\s*(Build)?([Rr][eE]quire[Ss]|Recommends|Suggests|Supplements|Enhances)(\(postu?n?\))?:\s+(.*)' @@ -140,6 +144,7 @@ SPECIAL = { 'python2-fedmsg-core': 'python2-fedmsg-core', 'python2-fedmsg-consumers': 'python2-fedmsg-consumers', 'python2-fedmsg-commands': 'python2-fedmsg-commands', + 'python-pillow-qt': 'python2-pillow-qt', } REPLACEMENT_MACROS = ( @@ -200,6 +205,8 @@ class RequiresModifier(BaseModifier): line = '%if (0%{?fedora} && 0%{?fedora} <= 23) || (0%{?rhel} && 0%{?rhel} <= 7)' if line == '%if 0%{?rhel} <= 6': line = '%if 0%{?rhel} && 0%{?rhel} <= 6' + if line == '%if 0%{?rhel} <= 7': + line = '%if 0%{?rhel} && 0%{?rhel} <= 7' if line == '%if 0%{?fedora} < 11 || 0%{?rhel} <= 6': line = '%if 0%{?rhel} && 0%{?rhel} <= 6' if line == '%if %{?rhel}%{!?rhel:0} <= 5': @@ -289,15 +296,24 @@ class RequiresModifier(BaseModifier): require = 'python2-numpy%{?_isa}' if require == 'scipy%{?_isa}': require = 'python2-scipy%{?_isa}' + if require == 'python-behave': # packaging error in behave require = 'python2-behave' + if require == 'python-smbios': require = 'python3-smbios' # it already obsoletes python-smbios + if require == 'python-xcffib': # packaging error, does not use %python_provide require = 'python2-xcffib' - if require == 'python-pyasn1%{!?el6: >= 0.1.3}': - require = 'python2-pyasn1%{!?el6: >= 0.1.3}' + if require == 'python-pyasn1%{!?el6:': + require = 'python2-pyasn1%{!?el6:' + + if require == '%{_bindir}/python': + require = '%{_bindir}/python2' + + if require == 'python-qt5-devel': + require = 'python2-qt5-devel' # ------------- # If the package does not depend on # python2, then we do not care about it (e.g. python-rpm-macros)