summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2017-04-02 14:11:41 +0200
committerOlav Vitters <olav@vitters.nl>2017-04-02 14:11:41 +0200
commit4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2 (patch)
treef471a30f61f78cd36723fddeb3100f5b91296fd2
parenteea3e33708312357cee7d29bc6a06f4a24ed2e58 (diff)
downloadmgagnome-4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2.tar
mgagnome-4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2.tar.gz
mgagnome-4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2.tar.bz2
mgagnome-4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2.tar.xz
mgagnome-4d7a4c9e64ff893cd9ce59b9b9b90b2298674ad2.zip
fix byte vs string handling in clean-spec --convert
-rwxr-xr-xmgagnome12
1 files changed, 6 insertions, 6 deletions
diff --git a/mgagnome b/mgagnome
index df6d89b..1dc09c1 100755
--- a/mgagnome
+++ b/mgagnome
@@ -547,7 +547,7 @@ class SpecFile(object):
if (flag & rpm.RPMSENSE_GREATER): ver_cmp += '>'
if (flag & rpm.RPMSENSE_EQUAL): ver_cmp += '='
- br[req] = (ver_cmp, ver)
+ br[req.decode('utf-8')] = (ver_cmp, ver)
return br
@property
@@ -718,7 +718,7 @@ class SpecFile(object):
made_changes = True
self._changes['SILENT %s' % change_description] = True
elif len(changes) != 0:
- print("ERROR: Could not update buildrequires!", file=sys.stderr)
+ print("ERROR: Could not update buildrequires for %s" % self.module, file=sys.stderr)
print(changes)
return False
@@ -1404,18 +1404,18 @@ def cmd_clean_spec_multi(args):
convert_brs = {
'pkgconfig': {
'desc': 'convert -devel buildrequires into pkgconfig',
- 'check_br': lambda req: req.endswith(b'-devel'),
+ 'check_br': lambda req: req.endswith('-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(b'lib') else 'pkgconfig(lib%s)' % basereq
+ 'pkgconfig(%s)' % basereq[len('lib'):] if basereq.startswith('lib') else 'pkgconfig(lib%s)' % basereq
],
},
'perl': {
'desc': 'convert perl- buildrequires into perl()',
- 'check_br': lambda req: req.startswith(b'perl-'),
- 'check_provide': lambda prov: prov.startswith(b'perl('),
+ 'check_br': lambda req: req.startswith('perl-'),
+ 'check_provide': lambda prov: prov.startswith('perl('),
'basereq': lambda req: req[len('perl-'):],
'extra': lambda basereq: ['perl(%s)' % basereq.replace('-', '::')],
}