[Yum-devel] RFC: Package object comparison -- do we need a slight change?

Tim Lauridsen tim at rasmil.dk
Thu Oct 12 07:39:03 UTC 2006


seth vidal wrote:
> On Wed, 2006-10-11 at 23:05 -0400, seth vidal wrote:
>   
>> Sadly worthy of note:
>>
>> https://lists.dulug.duke.edu/pipermail/yum-devel/2006-August/002422.html
>>
>>     
>
> would it be possible to revert back PART of the way:
>
> - rich comparisons for packageobjects get moved into packageobj.ver
> object
> - 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,
> soonish.
>
> -sv
>
>
>   
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.

Tim






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.baseurl.org/pipermail/yum-devel/attachments/20061012/3248124d/attachment.htm 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: yum-compare.patch.txt
Url: http://lists.baseurl.org/pipermail/yum-devel/attachments/20061012/3248124d/attachment.txt 


More information about the Yum-devel mailing list