[Yum-devel] RFC: Package object comparison -- do we need a slight change?
tim at rasmil.dk
Thu Oct 12 07:45:15 UTC 2006
Tim Lauridsen wrote:
> seth vidal wrote:
>> On Wed, 2006-10-11 at 23:05 -0400, seth vidal wrote:
>>> Sadly worthy of note:
>> would it be possible to revert back PART of the way:
>> - rich comparisons for packageobjects get moved into packageobj.ver
>> - eq and ne methods defined for packageobjects which do a tuple
>> comparison instead.
>> We'd have to find all the <=> ver comparisons using just 'po' and fix
>> them but we'd get back the 'if po in polist' functionality and we'd also
>> get back a fair bit of expected behavior.
>> I know it would break code, but I'm not sure how else we can get to
>> where we need to be and actually be correct. And at the risk of being
>> worrisome - we also have to contend with this code potentially being in
>> rhel for a looooooooooooooooooong time. So it's better to get it right,
> My proposal is to remove the rich comparisons for package objects and
> add an EVR property there return a compareable
> packageEVR object, there contain the rich comparisons for evr. (See
> the attached patch)
> if po1 > po2: will have to be changed to
> if po1.EVR > po2.EVR: # Everybody should be able to see what we are
> comparing here.
To much cut & paste, there is a new patch.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Yum-devel