[Yum-devel] more thoughts on cli parsing
Michael Stenner
mstenner at linux.duke.edu
Fri Mar 26 15:24:49 UTC 2004
On Fri, Mar 26, 2004 at 01:09:10AM -0500, seth vidal wrote:
> yum [- or -- options] <command> pkgs pkgs pkgs pkgs
>
> so the - and -- options are easy.
>
> the first arg after the --options are done is the command - also easy -
> just pop off the first entry of the list.
>
> now the rest should be arguments to the command. Depending on the
> command they may be package names, package globs, package name.arch
> package name-ver-rel.arch, globals, or just other args.
This is very similar to how both cvs and distutils work, correct?
cvs -d myrepo update -d somedir
> on the commands that take packages as an argument we should look through
> every arg and see if it matches anything we could possibly make from the
> naevr data and then pass in a tuple of what it is trying to relate,
> replacing with None anything it's missing. In terms of cli arguments
> None == not specified which, to me, means 'anything'
How does that work with wildcards? Do wildcards match "." or not.
For example, is "foo*" equivalent to "foo*.*" ?
> we might also have to do things the slow way if we don't find a match
> the fast way. If we iterate over all the keys in the dict that we've
> made and do the regex form of the fnmatch (fnmatch is really slow b/c of
> all the calls to normcase()) we should be able to find all potential
> matches in our pkgSack or in the rpmdb.
>
> Does that sound about right to y'all?
I think so. I'm a little unclear about what the "fast way" is.
-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