[Yum-devel] [PATCH] Fix for https://bugzilla.redhat.com/show_bug.cgi?id=520810
Seth Vidal
skvidal at fedoraproject.org
Wed Sep 2 17:44:21 UTC 2009
On Wed, 2 Sep 2009, Ville Skyttä wrote:
> On Wednesday 02 September 2009, Seth Vidal wrote:
>> just b/c it looks like a glob doesn't mean it IS a glob:
>> /usr/bin/[ is a legit file in coreutils but it looks (and acts)
>> just like a glob - so we need to do an ='s search even if it looks
>> like a glob. This makes me cranky.
>
> I'd argue that the presence of "[" alone in a string doesn't make it a glob
> candidate - it needs to be followed by a "]" for that. Ditto for "]" without
> a preceding "[". And there also needs to be something between them. So maybe
> this in re_glob() would be a better fix:
>
> - _re_compiled_glob_match = re.compile('.*[\*\?\[\]].*')
> + _re_compiled_glob_match = re.compile('.*([*?]|\[.+\])')
>
> (while at it, dropped some unnecessary backslashes and trailing .*)
That doesn't seem like a bad choice, no.
thanks,
-sv
More information about the Yum-devel
mailing list