From 8f1a4d02dca100a864f153f265e29f47985ae7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 5 Jun 2010 19:44:09 +0000 Subject: [PATCH] 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 --- Pkg.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Pkg.py b/Pkg.py index fef2f956..cdea04c4 100644 --- a/Pkg.py +++ b/Pkg.py @@ -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))