On Wed, 2011-12-21 at 22:26 +0200, Ville Skyttä wrote: > On 2011-12-21 10:44, Zdenek Pavlas wrote: > >> installed, available = base.doGroupLists( > >> patterns=[get_pattern(extcmds)]) > >> ... > >> def get_pattern(extcmds): > >> if len(extcmds) > 1 and extcmds[1]: > >> return shlex.split(extcmds[1])[0] + "*" > >> return "*" > > > > Not 100% sure about this but it feels wrong. > > I think extcmds was already split by shell, > > so this eats escapes. > > The very purpose of that code is to "eat" escapes - the helper may > receive shell escaped input and we cannot use it for yum pattern > matching without undoing the escaping. Group completion is the only one > where this certainly does happen (backslash escaped spaces, parenthesis) > but it may happen with others as well, depending on what the user feeds us.
I'm confused, can you give some examples? It certainly seems like something else is wrong if we have to do shell escaping manually. I guess the user types: yum install @foo\ b<tab> ...and then what happens? > > I'd just use the last argument. > > Currently nothing else besides zero or one word after the command > argument is supported, so at the moment it doesn't make a difference if > we look at the first or the last one. I don't have an opinion on this, > so I've pushed a modified version of this patch that looks up the last arg. We don't do this anywhere else in yum, and I don't see the point, but w/e it's not like it'll be used directly by users much. _______________________________________________ Yum-devel mailing list Yum-devel@lists.baseurl.org http://lists.baseurl.org/mailman/listinfo/yum-devel