[Yum-devel] [PATCH] Use basic string matching/replacing instead of regexps where appropriate.

Ville Skyttä ville.skytta at iki.fi
Tue Sep 22 21:34:38 UTC 2009


On Tuesday 22 September 2009, James Antill wrote:
> On Tue, 2009-09-22 at 23:04 +0300, Ville Skyttä wrote:
> > +    return 'bin/' in filename or filename.startswith('/etc/') or \
> > +        filename == '/usr/lib/sendmail'
> 
>  Could you do these as:
> 
> if 'bin/' in filename:
>      return True
> if filenam.startswith('/etc/'):
>      return True
> if filename == '/usr/lib/sendmail':
>      return True
> return False

Sure, revised patch attached.

> ...also have you tested these with unicode and str?

Yes, on Fedora 11 (Python 2.6).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Use-basic-string-matching-replacing-instead-of-regex.patch
Type: text/x-patch
Size: 3949 bytes
Desc: not available
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20090923/34e902b9/attachment-0001.bin>


More information about the Yum-devel mailing list