Bug 227860

Summary: rpm python bindings think no epoch is lower than epoch 0, but rpm itself doesn't think this
Product: [Fedora] Fedora Reporter: Jesse Keating <jkeating>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: aca21, dcantrell, lmacken, notting, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-26 07:51:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test spec file none

Description Jesse Keating 2007-02-08 17:00:36 UTC
Recently a package went from Epoch: 0 to just not listing epoch at all.  This
was supposed to work, and it does if using say rpm -Uvh or yum to attempt the
upgrade.  However the rpm python bindings seem to think that epoch of None is
somehow lower than epoch 0 and thus tools doing version comparison in python get
this wrong.

 print rpm.labelCompare((None, '1.5.0.9', '7.fc6'), ('0', '1.5.0.9','2.fc6'))
-1

 print rpm.labelCompare(('0', '1.5.0.9', '7.fc6'), ('0', '1.5.0.9','2.fc6'))
1


As part of the packaging cleanup for the merger of core/extras, we wanted to
remove the unnecessary Epoch: 0 entries in spec files, but this may block us
form doing so.

Comment 1 Jeff Johnson 2007-02-08 20:53:35 UTC
Yep. labelCompare() has never been taught
    Mising Epoch: should be treated exactly the same as Epoch: 0

FWIW, there are better EVR comparison API's available than labelCompare()
many years now.

Comment 2 Paul Nasrat 2007-02-09 09:53:06 UTC
Created attachment 147750 [details]
Test spec file

Jesse - I don't think the actually impacts yum.  Try building attached spec
file, installing, remove epoch, bump release or version, rebuild and use yum
localupdate.

Comment 3 Jesse Keating 2007-02-09 13:21:04 UTC
This isn't about yum.  Bill Nottingham has a script that compares the verisons
of packages that are in the update directories, to prune the old ones.  The
script is using rpm python bindings to do the comparison, and this is why we
discovered that the python binding is miscomparing things that go from Epoch: 0
to None.

Comment 4 Christopher Aillon 2007-03-04 20:35:36 UTC
*** Bug 229637 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Johnson 2007-03-28 15:42:55 UTC
Fixed in rpm cvs, will be in rpm-4.4.9-02 when built.

Comment 6 Jesse Keating 2007-04-21 04:10:15 UTC
This isn't an F7 blocker IMHO, removing from tracker.

Comment 7 Panu Matilainen 2007-06-11 07:41:38 UTC
Fixed in rpm.org, will be in rpm 4.4.2.1 as well.

Comment 8 Jeff Johnson 2007-06-23 11:53:15 UTC
CLOSED

Comment 9 Panu Matilainen 2007-06-26 07:51:48 UTC
Fixed in next rawhide push by rpm 4.4.2.1-rc1