summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2015-09-08 22:01:04 +0200
committerOlav Vitters <olav@vitters.nl>2015-09-08 22:01:04 +0200
commitaa439429c761919e06fd048a253555a6baced4f6 (patch)
tree6b93b346e543fcf9fd157d006eb71ac16af3535d
parent70e5c7576e5c0ac5da5c22dfdcb2fea2c3572cc9 (diff)
downloadmgagnome-aa439429c761919e06fd048a253555a6baced4f6.tar
mgagnome-aa439429c761919e06fd048a253555a6baced4f6.tar.gz
mgagnome-aa439429c761919e06fd048a253555a6baced4f6.tar.bz2
mgagnome-aa439429c761919e06fd048a253555a6baced4f6.tar.xz
mgagnome-aa439429c761919e06fd048a253555a6baced4f6.zip
python3 fixes
-rwxr-xr-xmgagnome17
1 files changed, 12 insertions, 5 deletions
diff --git a/mgagnome b/mgagnome
index 5857803..142296d 100755
--- a/mgagnome
+++ b/mgagnome
@@ -354,6 +354,7 @@ class SpecFile(object):
('remove unneeded setup option', None, re.compile(r'^(?P<keeppre>\%setup -q )-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>.\g<keeppost>', re.compile(r'^(?P<keeppre>%{_libdir}[^\n]+})(?P<keeppost>\*)$', re.MULTILINE))
]
re_convert_br = [
('remove py_requires', ('python',), re.compile(r'^\%(?:py_requires|\{py_requires\})[ \t]*\n', re.MULTILINE)),
@@ -683,6 +684,7 @@ class SpecFile(object):
self._changes.append('SILENT %s' % change_description)
elif len(changes) != 0:
print("ERROR: Could not update buildrequires!", file=sys.stderr)
+ print(changes)
return False
# Overwrite file with new version number
@@ -1346,18 +1348,18 @@ def cmd_clean_spec_multi(args):
convert_brs = {
'pkgconfig': {
'desc': 'convert -devel buildrequires into pkgconfig',
- 'check_br': lambda req: req.endswith('-devel'),
+ 'check_br': lambda req: req.endswith(b'-devel'),
'check_provide': lambda prov: prov.startswith('pkgconfig('),
'basereq': lambda req: req[:-len('-devel')],
'extra': lambda basereq: [
'pkgconfig(%s)' % basereq,
- 'pkgconfig(%s)' % basereq[len('lib'):] if basereq.startswith('lib') else 'pkgconfig(lib%s)' % basereq
+ 'pkgconfig(%s)' % basereq[len('lib'):] if basereq.startswith(b'lib') else 'pkgconfig(lib%s)' % basereq
],
},
'perl': {
'desc': 'convert perl- buildrequires into perl()',
- 'check_br': lambda req: req.startswith('perl-'),
- 'check_provide': lambda prov: prov.startswith('perl('),
+ 'check_br': lambda req: req.startswith(b'perl-'),
+ 'check_provide': lambda prov: prov.startswith(b'perl('),
'basereq': lambda req: req[len('perl-'):],
'extra': lambda basereq: ['perl(%s)' % basereq.replace('-', '::')],
}
@@ -1424,8 +1426,12 @@ def cmd_clean_spec(options, parser):
else:
packages = options.package if len(options.package) else (l[0] for l in join_streams())
+
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
executor.map(cmd_clean_spec_multi, ((options, package) for package in packages))
+# DEBUG:
+# for package in packages:
+# cmd_clean_spec_multi((options, package))
def cmd_package_new_version(options, parser):
# Determine the package name
@@ -1553,7 +1559,8 @@ def cmd_parse_ftp_release_list(options, parser):
try:
packages = Downstream().get_downstream_from_upstream(module, version)
except ValueError as e:
- print("ERROR: %s" % e, file=stderr)
+ #print(bytes("ERROR: %s" % str(e), 'UTF-8'), file=stderr)
+ stderr.write(bytes("ERROR: %s" % str(e), 'UTF-8'))
if options.mail: _send_reply_mail(stdout, msg, options.mail, error=True)
sys.exit(1)