summaryrefslogtreecommitdiffstats
path: root/mgagnome
diff options
context:
space:
mode:
Diffstat (limited to 'mgagnome')
-rwxr-xr-xmgagnome9
1 files changed, 7 insertions, 2 deletions
diff --git a/mgagnome b/mgagnome
index d7d2b27..ec380a5 100755
--- a/mgagnome
+++ b/mgagnome
@@ -354,7 +354,8 @@ class SpecFile(object):
('remove unneeded setup option', None, re.compile(r'^(?P<keeppre>\%setup -q)(?: -n|n) (?:\%name|\%\{name\})-(?:\%version|\%\{version\})(?P<keeppost>\n)', re.MULTILINE + re.IGNORECASE)),
('https for download.gnome.org', r'\g<keeppre>https://\g<keeppost>', re.compile(r'^(?P<keeppre>Source[0-9]*[ \t]*:[^\n]+)http://(?P<keeppost>download.gnome.org/[^\n]+\n)', re.MULTILINE + re.IGNORECASE)),
('download.gnome.org instead of ftp.gnome.org', r'\g<keeppre>https://download.gnome.org\g<keeppost>', re.compile(r'^(?P<keeppre>Source[0-9]*[ \t]*:[^\n]+)(?:ftp|http|https)://ftp.gnome.org/pub/GNOME(?P<keeppost>/[^\n]+\n)', re.MULTILINE + re.IGNORECASE)),
- ('restrict what libraries are matched with major numbers', r'\g<keeppre>{,.*}', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})\.?\*$', re.MULTILINE)),
+ ('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)),
]
re_convert_br = [
@@ -450,6 +451,10 @@ class SpecFile(object):
if not patches:
return made_changes, data
+ if len(patches) > 5:
+ print("NOTICE: More than 5 patches, skipping package", file=sys.stderr)
+ return made_changes, data
+
if self.uses_apply_patches:
return made_changes, data
@@ -472,7 +477,7 @@ class SpecFile(object):
print("NOTICE: Unable to automatically convert %s patches into %%autopatch (header/patch/valid: %s, %s, %s)" % (self.module, len(patch_nrs_header), len(patch_nrs_any), len(patch_nrs_valid)), file=sys.stderr)
return made_changes, data
- patch_flags = set([mo.group('strip') for mo in re_patch_valid.finditer(mo2.group(0))])
+ patch_flags = set([0 if mo.group('strip') is None else mo.group('strip') for mo in re_patch_valid.finditer(mo2.group(0))])
if len(patch_flags) != 1:
print("NOTICE: Unable to automatically convert patches into as different -p / strip levels used", file=sys.stderr)