[Libosinfo] [PATCH 1/2] debian-squeeze: Fix volume-id expression

Christophe Fergeau cfergeau at redhat.com
Fri May 20 11:30:22 UTC 2016


On Thu, May 19, 2016 at 11:20:02PM +0200, Fabiano Fidêncio wrote:
> The volume-id expression should be able to match things like: 6.0.0,
> 6.0.1a, 6.0.10.

Oh, do they really use .1a? Can we have a testcase for it? How is it
ordered, I assume this is hex representation?

> [ffidenci at cat libosinfo]$ python

should be python 3, we are in 2016 ;)

> Python 2.7.11 (default, Feb  5 2016, 01:53:41)
> [GCC 6.0.0 20160201 (Red Hat 6.0.0-0.9)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import re
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.0')
> <_sre.SRE_Match object at 0x7f50d7de2578>
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.1')
> <_sre.SRE_Match object at 0x7f50d7de25e0>
> >>> re.match(r'6.\d.\d\d?\d?', '6.0.1a')
> <_sre.SRE_Match object at 0x7f50d7de2578>

Nope, this is not correct, you matched '6.0.1', not the full string:

>>> re.match(r'6.\d.\d\d?\d?$', '6.0.1a')
>>>


Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20160520/76c59c04/attachment.sig>


More information about the Libosinfo mailing list