[Yum-devel] None vs 0 Epoch in yum

Seth Vidal skvidal at fedoraproject.org
Sat Jun 5 17:02:52 UTC 2010



On Sat, 5 Jun 2010, Ville Skyttä wrote:

> On Saturday 05 June 2010, Seth Vidal wrote:
>> On Sat, 5 Jun 2010, Ville Skyttä wrote:
>>> Hello,
>>>
>>> What's yum's take on 0 vs None Epochs?  Always treat them as equal, or
>>> play along with how the underlying rpm version treats them?
>>> (Implementation of a patch I'm about to submit depends on this.)
>>
>> None and 0 are equal for epochs.
>
> In yum, right?  I want to clarify this because there are versions of rpm still
> in use in which they are not always equal, for example the RHEL/CentOS 4 one.
>
> $ rpm -q rpm rpm-python
> rpm-4.3.3-32_nonptl
> rpm-python-4.3.3-32_nonptl
>
> $ python -c "import rpm; print rpm.labelCompare(('0', '1', '2'), (None, '1', '2'))"
> 1
>
> Also, for completeness (I don't have a real world test case for this), what
> about the empty string, in case it somehow ends up in an Epoch?  rpm treats
> it as different than 0 and None.  Should yum follow suit, or treat it as
> 0/None?


yum and createrepo say 'if there epoch == None then epoch=0'

we assert it to 0 and that's how rpm behaves, too.

anyone relying on the other behavior is in for a rude awakening.

-sv


More information about the Yum-devel mailing list