[Yum-devel] standardize on a package object?

Panu Matilainen pmatilai at laiskiainen.org
Mon Aug 21 06:38:46 UTC 2006


On Sun, 20 Aug 2006, seth vidal wrote:

> Okay,
> At this point we have a package object representation available for
> everything. Now the question becomes do we want to start writing methods
> and converting all of our utility functions to take package objects.
>
> We frequently do something like:
>
> (n1,a1,e1,v1,r1) = pkg.pkgtup
> (n2,a2,e2,v2,r2) = instpkg.pkgtup
> rc = rpmUtils.miscutils.compareEVR((e, v, r), (te, tv, tr))
> ....
>
> would it make sense for us to have a compareEVR that took package
> objects?
>
> so we could just do
> rc = rpmUtils.miscutils.compareEVR(pkg, instpkg)
>
> and drop a lot of extra, confusing code in places where we need less
> garbage to make it more readable?

I remember wondering about those endless tuple <-> pkg conversions back in 
2.1.x days when I started looking at yum code - sounds like a good plan to 
me.

> if we do want to do this then I have two questions:
> 1. do we want to make a better set of utility functions for yum?
> 2. do we want to make them be able to handle both a package object and
> what they handled before? (most of the time tuples)
> let me know what you think, please
> -sv

Maybe yumUtils module for higher level (eg dealing with package 
objects only) utils and leave the lower level rpmUtils as is...
Just a thought, haven't looked at the code in a long time :-/

 	- Panu -



More information about the Yum-devel mailing list