Don't stringify None Epoch to 'None' string in compareEVR().

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1793 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2010-06-05 19:44:09 +00:00
parent be2e601801
commit 8f1a4d02dc
1 changed files with 6 additions and 3 deletions

9
Pkg.py
View File

@ -194,15 +194,18 @@ def get_default_valid_rpmgroups(filename = None):
groups.sort()
return groups
# from yum 3.2.23, rpmUtils.miscutils
# from yum 3.2.27, rpmUtils.miscutils, with rpmlint modifications
def compareEVR((e1, v1, r1), (e2, v2, r2)):
# return 1: a is newer than b
# 0: a and b are the same version
# -1: b is newer than a
e1 = str(e1)
# rpmlint mod: don't stringify None epochs to 'None' strings
if e1 is not None:
e1 = str(e1)
v1 = str(v1)
r1 = str(r1)
e2 = str(e2)
if e2 is not None:
e2 = str(e2)
v2 = str(v2)
r2 = str(r2)
rc = rpm.labelCompare((e1, v1, r1), (e2, v2, r2))