1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

Return bytes in packagequery.PackageQueryResult.evr() instead of a str

The packagequery.PackageQueryResult class is supposed to provide a
bytes API. Hence, packagequery.PackageQueryResult.evr() should return
bytes instead of a str. Also, adjust the single caller in the build
module.
This commit is contained in:
Marcus Huewe 2020-03-15 17:13:21 +01:00
parent 3914b8c5e8
commit cd51f47a77
2 changed files with 4 additions and 4 deletions

View File

@ -480,7 +480,7 @@ def create_deps(pkgqs):
d = p.supplements()
if d:
depfile.append(b's:%s%s' % (id, b' '.join(d)))
depfile.append(b'I:%s%s-%s 0-%s' % (id, p.name(), p.evr().encode(), p.arch()))
depfile.append(b'I:%s%s-%s 0-%s' % (id, p.name(), p.evr(), p.arch()))
return depfile

View File

@ -151,14 +151,14 @@ class PackageQueryResult:
raise NotImplementedError
def evr(self):
evr = decode_it(self.version())
evr = self.version()
if self.release():
evr += "-" + decode_it(self.release())
evr += b"-" + self.release()
epoch = self.epoch()
if epoch is not None and epoch != 0:
evr = epoch + ":" + evr
evr = epoch + b":" + evr
return evr