[Yum-devel] repo priorities

seth vidal skvidal at fedoraproject.org
Thu Sep 6 19:37:35 UTC 2007


On Thu, 2007-09-06 at 08:26 +0200, Tim Lauridsen wrote:
> >   
> +1, for inclusion in core.
> something like
> cost=5
> in the repo file.
> the default value for cost should be '10' or something like that.

So here's an interesting twist.

cost is really an attribute of a package. Since there's nothing saying a
package in repodata has to be at the same url as the repo. So if we're
working along those lines we make cost be listed in the repo config but
we add it as an attribute of all the pkgs in that repo. This opens up
new angles for plugins.

so arguably a plugin could do:

for pkg in allpkgs:
    if pkg.basepath.startswith(ftp://):
        pkg.cost = 80000
    ...

it also makes comparisons in the future easier:

   if all other things about these pkgs are the same:
     pkg.cost > pkg.cost...

What do y'all think? Does that make sense?

-sv





More information about the Yum-devel mailing list