More accurate regexp on re_vnum

This commit is contained in:
Thomas Nagy 2015-03-12 19:22:08 +01:00
parent 52f63ac945
commit 4a362be394
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
1 changed files with 2 additions and 2 deletions

View File

@ -479,7 +479,7 @@ def apply_implib(self):
# ============ the code above must not know anything about vnum processing on unix platforms =========
re_vnum = re.compile('^([1-9]\\d*|0)([.]([1-9]\\d*|0)[.]([1-9]\\d*|0))?$')
re_vnum = re.compile('^([1-9]\\d*|0)([.]([1-9]\\d*|0)){0,2}?$')
@feature('cshlib', 'cxxshlib', 'dshlib', 'fcshlib', 'vnum')
@after_method('apply_link', 'propagate_uselib_vars')
def apply_vnum(self):
@ -499,7 +499,7 @@ def apply_vnum(self):
link = self.link_task
if not re_vnum.match(self.vnum):
raise Errors.WafError('Invalid version %r for %r' % (self.vnum, self))
raise Errors.WafError('Invalid vnum %r for target %r' % (self.vnum, getattr(self, 'name', self)))
nums = self.vnum.split('.')
node = link.outputs[0]