mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 02:36:15 +01:00
Merge pull request #524 from lethliel/python3_packagequery_fix_decoding
[python3] fix decoding for packageqeury.py
This commit is contained in:
commit
6c074fce20
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
from osc.util.helper import decode_it
|
||||||
|
|
||||||
class PackageError(Exception):
|
class PackageError(Exception):
|
||||||
"""base class for all package related errors"""
|
"""base class for all package related errors"""
|
||||||
@ -30,11 +31,11 @@ class PackageQueries(dict):
|
|||||||
self.__setitem__(query.name(), query)
|
self.__setitem__(query.name(), query)
|
||||||
|
|
||||||
def __setitem__(self, name, query):
|
def __setitem__(self, name, query):
|
||||||
if name != query.name():
|
if decode_it(name) != decode_it(query.name()):
|
||||||
raise ValueError("key '%s' does not match "
|
raise ValueError("key '%s' does not match "
|
||||||
"package query name '%s'" % (name, query.name()))
|
"package query name '%s'" % (name, query.name()))
|
||||||
|
|
||||||
architecture = query.arch()
|
architecture = decode_it(query.arch())
|
||||||
|
|
||||||
if (architecture in [self.wanted_architecture, 'noarch', 'all', 'any']
|
if (architecture in [self.wanted_architecture, 'noarch', 'all', 'any']
|
||||||
or self.wanted_architecture in self.architectureMap.get(architecture,
|
or self.wanted_architecture in self.architectureMap.get(architecture,
|
||||||
@ -149,10 +150,10 @@ class PackageQueryResult:
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def evr(self):
|
def evr(self):
|
||||||
evr = self.version()
|
evr = decode_it(self.version())
|
||||||
|
|
||||||
if self.release():
|
if self.release():
|
||||||
evr += "-" + self.release()
|
evr += "-" + decode_it(self.release())
|
||||||
|
|
||||||
epoch = self.epoch()
|
epoch = self.epoch()
|
||||||
if epoch is not None and epoch != 0:
|
if epoch is not None and epoch != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user