[Yum-devel] [PATCH] Fix for https://bugzilla.redhat.com/show_bug.cgi?id=520810

Ville Skyttä ville.skytta at iki.fi
Wed Sep 2 17:37:45 UTC 2009


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 .*)


More information about the Yum-devel mailing list