diff options
author | Olav Vitters <olav@vitters.nl> | 2014-07-06 20:49:48 +0200 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2014-07-06 20:49:48 +0200 |
commit | 78ce6f02df652a57f257d933d0032d4f6d01a0a8 (patch) | |
tree | 02f6f95840d9fa8aa4e23da0d040e08f5298f31d | |
parent | c1cbcf06da762372d31bc69ab8b09e9d1c03bc34 (diff) | |
download | mgagnome-78ce6f02df652a57f257d933d0032d4f6d01a0a8.tar mgagnome-78ce6f02df652a57f257d933d0032d4f6d01a0a8.tar.gz mgagnome-78ce6f02df652a57f257d933d0032d4f6d01a0a8.tar.bz2 mgagnome-78ce6f02df652a57f257d933d0032d4f6d01a0a8.tar.xz mgagnome-78ce6f02df652a57f257d933d0032d4f6d01a0a8.zip |
handle variations for py_requires as well as unneeded variable names
-rwxr-xr-x | mgagnome | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -390,8 +390,8 @@ class SpecFile(object): ('remove buildroot definition', re.compile(r'^BuildRoot:[^\n]+\n', re.MULTILINE + re.IGNORECASE)), ] re_convert_br = [ - ('remove py_requires', ('python',), re.compile(r'^\%py_requires[ \t]*\n', re.MULTILINE)), - ('remove py_requires -d', ('python', 'python-devel'), re.compile(r'^\%py_requires[ \t]+-d[ \t]*\n', re.MULTILINE)), + ('remove py_requires', ('python',), re.compile(r'^\%(?:py_requires|\{py_requires\})[ \t]*\n', re.MULTILINE)), + ('remove py_requires -d', ('python', 'python-devel'), re.compile(r'^\%(?:py_requires[ \t]+-d|\{py_requires[ \t]+-d\})[ \t]*\n', re.MULTILINE)), ] made_changes = False @@ -435,7 +435,7 @@ class SpecFile(object): # name: SOMETHING converted_defines = [] for search_for in ('name', 'version', 'release', 'summary', 'group'): - re_spec = re.compile(r'^(?P<keeppre>' + re.escape(search_for) + r'[ \t]*:[ \t]*)\%\{' + re.escape(search_for) + r'\}(?P<keeppost>[ \t]*\n)', re.MULTILINE + re.IGNORECASE) + re_spec = re.compile(r'^(?P<keeppre>' + re.escape(search_for) + r'[ \t]*:[ \t]*)(?:\%' + re.escape(search_for) + r'|\%\{' + re.escape(search_for) + r'\})(?P<keeppost>[ \t]*\n)', re.MULTILINE + re.IGNORECASE) regexp = r'^(?P<keeppre>\%define[ \t]+'+ re.escape(search_for) + r'[ \t]+(?P<variable>\S+))(?P<keeppost>[ \t]*\n)' re_variable = re.compile(r'^(?P<keeppre>\%define[ \t]+'+ re.escape(search_for) + r'[ \t]+(?P<definition>[^\n]+?))(?P<keeppost>[ \t]*\n)', re.MULTILINE + re.IGNORECASE) |