[Yum-devel] YumBaseCli and yum-utils

Tim Lauridsen tim at rasmil.dk
Tue Nov 7 08:35:33 UTC 2006


seth vidal wrote:
> Hey,
>  for some of the yum-utils would it make sense to use the YumBaseCli
> object instead of the YumBase object? Then we could do things that
> present info to the user and get user feedback w/o having to recreate
> all of it in the util.
>
> ie: look at how package-cleanup does the old kernel removal.
>
> it seems like it'd be easier just to grab the equivalent pieces from cli
> by using them.
>
> See a simple dupes-cleaner as attached.
>
> -sv
>
>   
I would be nice if it was possible to reuse the optparser stuff definded 
in YumBaseCli.getOptionsConfig, so a yum-util could inherit the basic 
command line option like -C, -c ,--noplugins, -y etc.
it could be done by splitting YumBaseCli.getOptionsConfig into 3 methods.

preConfigSetup  : The basic optparser setup.
ConfigSetup        : The doConfigSetup stuff.
postConfigSetup  : the opts -> conf stuff, repo enable disable, the 
exclude setup

The yum-util could then
1. Call the preConfigSetup if it want to inherit the base yum options
2. Add some more options.
3. do it own doConfigSetup()
4. Call the postConfigSetup()
5. Do actions for the utils own options.

Tim



More information about the Yum-devel mailing list