Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 227860 - rpm python bindings think no epoch is lower than epoch 0, but rpm itself doesn't think this
Summary: rpm python bindings think no epoch is lower than epoch 0, but rpm itself does...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
: 229637 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-08 17:00 UTC by Jesse Keating
Modified: 2013-01-10 02:35 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-26 07:51:48 UTC


Attachments (Terms of Use)
Test spec file (deleted)
2007-02-09 09:53 UTC, Paul Nasrat
no flags Details

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 


Note You need to log in before you can comment on or make changes to this bug.