[Yum-devel] yum command tree

Michael Stenner mstenner at linux.duke.edu
Fri May 14 19:29:28 UTC 2004


On Fri, May 14, 2004 at 03:23:26AM -0400, seth vidal wrote:
> So I was working on the doCommands() routine in yum and I wanted to
> sketch out all the args I would have to deal with in advance.
> 
> So I wrote out a list of the commands that yum either has or that I want
> it to have. Some of them are just neat ideas - but I'd like some input
> -and if someone wants work on one of them, go for it.
> 
> yum commands
>  - list/info

Am I to understand that list and info take the same args, but simply
produce different outputs?  If so, this inspires a crazy idea that
would be very powerful, but might be a PITA.  Something along the
lines of rpm's --qf.  Something like '--listformat="%n %v %r" etc,
which modifies the output format of 'list'.  Probably the best way to
do this would be to simply build a python dict for each package and
then allow the user to directly pass a dict-based format string:  
  "%(name)s %(version) %(repo)s"

Probably the tidiest thing to do would be to simply have a default
listformat and have "info" act as an alias for a different format.

>     - available
>     - installed
>     - all
>     - extras
>     - updates
>     - obsoletes

It would be nice if 'list all' indicated which "set" the package is in
(installed, available, etc).  This could be done per-package or simply
by grouping them under headers.  However, the latter doesn't work so
well when grepping.

>     - reponame - complete dump

You mean "yum list dulug"?  I'd suggest staying away from syntax where
you can expect either an "option" or an "argument".  For example, what
If I name a repo "updates"?  Similarly, I could name a repo "xfce".
I'd suggest "yum list repo dulug".  Basically, I think 'yum list'
should come in one of 3 forms:

  yum list                        (equivalent to 'list all', probably)
  yum list <option>               (eg. 'yum list updates')
  yum list <option> <argument(s)> (eg. 'yum list repo dulug')

That way, if anything comes after 'yum list', it MUST be one of the
available options.

>     - package string+

Same, see above.  I recommend 'yum list package xfce'.

>     - null == available

I'm ok with this defaulting to 'available'.

>     - recent ? (check timestamp for last N days)

Sounds good.

>  - update
>    - package string+
>    - null == global update
>  
>  - install/remove/erase
>    - package string+
>    - null == error
>    
>  - check-update
>    - null == check all
>    - arguments - ignored
>  
>  - search/provides
>    - null == error
>    - match string+

Might be nice to have the option to control where 'search' looks for
the match string.  Perhaps a --searchfields=name,desc option.  Also,
it would be cool if search/provides also took a similar listformat
option.  In fact, the two could be combined into one.  You could
simply have the 'match' element be '(none)' or something for all but
search.

I think I'm coming to a more generalized searching concept that has
some appeal.  For example, 'yum query deps httpd\*' would be
equivalent to 
  yum --format '%(name) %(deps)' --searchfields=name search httpd\*

Now, obviously, there is some appeal in simply typing the former.
However, it might be nice to interally generalize the searching
functions so there's really only one search routine.  Then you could
make that available so you can get the full power if you want it.
Then you could implement all of the other search functions as aliases
to that one super-search function.

>  - grouplist
>    - null == list of groups
>    - group string = list packages in group+
>    
>  - groupupdate
>    - null == groupupdate all installed
>    - group string+
>    
>  - groupinstall/groupremove
>    - null == error
>    - group string+
> 
>  - clean
>    - packages
>    - metadata
>    - old-packages  
>    - purge - completely purge all cache dirs
>    - null == packages, metadata

These look good.

> [possible commands]   
> - query <thing> <package string>+ - lists the thing for all packages
> matching
>                                       the package strings.
>                                       
>     thing = deps, provides, files, obsoletes, conflicts, changelog, dump

See above.

> - queue
>    (attach queue commands here)

					-Michael
-- 
  Michael D. Stenner                            mstenner at ece.arizona.edu
  ECE Department, the University of Arizona                 520-626-1619
  1230 E. Speedway Blvd., Tucson, AZ 85721-0104                 ECE 524G



More information about the Yum-devel mailing list