Bug 227860 - rpm python bindings think no epoch is lower than epoch 0, but rpm itself doesn't think this
rpm python bindings think no epoch is lower than epoch 0, but rpm itself does...
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
: 229637 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2007-02-08 12:00 EST by Jesse Keating
Modified: 2013-01-09 21:35 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-06-26 03:51:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test spec file (517 bytes, text/plain)
2007-02-09 04:53 EST, Paul Nasrat
no flags Details

  None (edit)
Description Jesse Keating 2007-02-08 12:00:36 EST
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, '', '7.fc6'), ('0', '','2.fc6'))

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

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 15:53:35 EST
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 04:53:06 EST
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
Comment 3 Jesse Keating 2007-02-09 08:21:04 EST
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 15:35:36 EST
*** Bug 229637 has been marked as a duplicate of this bug. ***
Comment 5 Jeff Johnson 2007-03-28 11:42:55 EDT
Fixed in rpm cvs, will be in rpm-4.4.9-02 when built.
Comment 6 Jesse Keating 2007-04-21 00:10:15 EDT
This isn't an F7 blocker IMHO, removing from tracker.
Comment 7 Panu Matilainen 2007-06-11 03:41:38 EDT
Fixed in rpm.org, will be in rpm as well.
Comment 8 Jeff Johnson 2007-06-23 07:53:15 EDT
Comment 9 Panu Matilainen 2007-06-26 03:51:48 EDT
Fixed in next rawhide push by rpm 

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