diff options
Diffstat (limited to 'mgagnome')
-rwxr-xr-x | mgagnome | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -303,7 +303,7 @@ def clean_pkgconfig_prov(prov): class SpecFile(object): re_update_version = re.compile(r'^(?P<pre>Version[ \t]*:\s*)(?P<version>.+)(?P<post>\s*)$', re.MULTILINE + re.IGNORECASE) re_update_release = re.compile(r'^(?P<pre>Release[ \t]*:\s*)(?P<release>%mkrel [0-9.]+)(?P<post>\s*)$', re.MULTILINE + re.IGNORECASE) - re_update_patch = re.compile(r'^(?P<pre>Patch)(?P<nr>[0-9]*)(?P<pre2>[ \t]*:\s*)(?P<patch>.+)(?P<post>\s*)\n', re.MULTILINE + re.IGNORECASE) + re_update_patch = re.compile(r'^(?P<pre>Patch0*?)(?P<nr>[0-9]*)(?P<pre2>[ \t]*:\s*)(?P<patch>.+)(?P<post>\s*)\n', re.MULTILINE + re.IGNORECASE) re_br_part = re.compile(r'(?P<br>[^\s%{},<>=][^\s%{},<>=]*)\b(?P<post>\s*(?:(?P<operator>=|>=|<=|=<|=>|>|<)\s*(?P<version>[^\s%{},]+|\%\{[^\s{%}]+\}|\%[^\s%{},]+)\b)?)') @@ -360,6 +360,18 @@ class SpecFile(object): ('restrict what libraries are matched with major numbers', r'\g<keeppre>{,.*}', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})\*$', re.MULTILINE)), ('keep library matching using two lines', r'\g<keeppre>\n\g<keeppre>.*', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})$\n(?P=keeppre)\{,\.\*\}$', re.MULTILINE)), ('make use of autopatch', r'%autopatch -p1', re.compile(r'^%apply_patches$', re.MULTILINE)), + # Use new Python macros + ('use new Python macros', r'%py2_build', re.compile(r'^%{__python} setup.py build$', re.MULTILINE)), + ('use new Python macros', r'%py3_build', re.compile(r'^%{__python3} setup.py build$', re.MULTILINE)), + + ('use new Python macros', r'%py2_install', re.compile(r'^%{__python} setup.py install$', re.MULTILINE)), + ('use new Python macros', r'%py3_install', re.compile(r'^%{__python3} setup.py install$', re.MULTILINE)), + + ('use new Python macros', r'%{python2_sitelib}', re.compile(r'^%{python_sitelib}', re.MULTILINE)), + ('use new Python macros', r'%{python2_sitearch}', re.compile(r'^%{python_sitearch}', re.MULTILINE)), + + ('use new Python macros', r'%{python2_version}', re.compile(r'%{pyver}', re.MULTILINE)), + ('use new Python macros', r'%{python3_version}', re.compile(r'%{py3ver}', re.MULTILINE)), ] re_convert_br = [ ('remove py_requires', ('python',), re.compile(r'^\%(?:py_requires|\{py_requires\})[ \t]*\n', re.MULTILINE)), @@ -540,7 +552,7 @@ class SpecFile(object): @property def uses_apply_patches(self): - return subprocess.call(['grep', '-Eq', '^%(apply_patches|autopatch)', '--', self.path]) == 0 + return subprocess.call(['grep', '-Eq', '^%(apply_patches|autopatch|autosetup)', '--', self.path]) == 0 def _revert_changes(self): """Revert uncommited changes made to spec file""" @@ -608,7 +620,7 @@ class SpecFile(object): cmd_before_parsed = shlex.split(cmd_before[0]) if cmd_before[0] else [] if not check_only and uses_apply_patches and patches and cmd_parsed: - if os.path.basename(cmd_parsed[0]) == 'patch': + if os.path.basename(cmd_parsed[0]) in ('patch', 'cat'): if os.path.exists(cmd_parsed[-1]): failed_patch = os.path.basename(cmd_parsed[-1]) elif cmd_parsed[-1].startswith('-') and os.path.exists(cmd_before_parsed[-1]): @@ -1286,6 +1298,8 @@ def cmd_check_latest(options, parser): safe_max_version = get_safe_max_version(spec_version, module=module) versions = Upstream.versions(module) + if package_version != spec_version and spec_version != 'N/A' and package_version != 'N/A': + upgrade.add('~') if versions: latest_version = get_latest_version(versions) safe_version = get_latest_version(versions, safe_max_version) |