[Yum-devel] Yum CLI/API consistency

seth vidal skvidal at linux.duke.edu
Thu Jan 26 23:08:04 UTC 2006


On Mon, 2006-01-23 at 12:14 -0500, Paul Nasrat wrote:
> Seth, 
> 
> You asked for some feedback about this sort of stuff so here's one case
> I think I should mention.
> 
> Currently we have a bunch of logic in cli.py which really should be
> handled by the YumBase.install() YumBase.update() and YumBase.remove()
> functions.
> 
> End goal - as a user I want to install everything[0]:
> 
> cli: yum install *
> API: yum.install('*')

gotcha. No implicit objection. There's a tiny bit of 'but it should be
prettier' but oh well.


> Currently cli uses packages.parsePackages, where YumBase.install uses
> searchNEVRA. The attached proof of concept patch makes install('*') work
> by taking advantage of sqlite's GLOB (we'd need to make non sqlite sacks
> work in the same manner).  Obviously we could also hand off to
> parsePackages if we see a glob instead, but I think that using sqlite
> GLOB is probably better.
> 


and the matching isn't quite the same b/t parsePackages and sqlite glob
- b/c the globbing matches w/i a column, not b/t columns.


So parsePackages will return something different than sqlite globbing
for things like:

foo-*-1.*

where the stars are intended to match PART of the name AND part of the
version AND the arch.

it makes it trickier and ickier, really.
b/c we won't know which column to match *-1.* against, clearly.


> I think we should be moving logic from cli.py to the methods in the
> YumBase object.  So that for non cli/pwd interactive things we pass off
> to YumBase.install().  Does this sound reasonable - I'll try and get a
> more complete patch done and clean up cli.py.

I agree but we also need to:
1. make it so the expected behavior doesn't change too much
2. clean up the unnecessary methods off of YumBase, if possible.

-sv





More information about the Yum-devel mailing list