diff options
author | Olav Vitters <olav@vitters.nl> | 2015-10-08 18:30:38 +0200 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2015-10-08 18:30:38 +0200 |
commit | a566bfe4398ff5baae38f4911aa07a9494a1e9cb (patch) | |
tree | f123cbfc77db7070afec5d187149b3f47f76e628 /mgagnome | |
parent | e6b6fb739ac178c4b4c72bfb2c08a660ffce24b3 (diff) | |
download | mgagnome-a566bfe4398ff5baae38f4911aa07a9494a1e9cb.tar mgagnome-a566bfe4398ff5baae38f4911aa07a9494a1e9cb.tar.gz mgagnome-a566bfe4398ff5baae38f4911aa07a9494a1e9cb.tar.bz2 mgagnome-a566bfe4398ff5baae38f4911aa07a9494a1e9cb.tar.xz mgagnome-a566bfe4398ff5baae38f4911aa07a9494a1e9cb.zip |
keep libraries on two lines; avoid trying to fix packages with loads of patches (hangs); fix a bug in handling of patch flags
Diffstat (limited to 'mgagnome')
-rwxr-xr-x | mgagnome | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) |