]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipeutils.py: allow all characters in regexes used to parse version strings
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Mon, 3 Aug 2015 16:29:54 +0000 (19:29 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 9 Aug 2015 22:14:32 +0000 (15:14 -0700)
Previously only numeric characters were matches and anything else was
discarded, so 4.0-rc3, 2005e, 1.0.2a and similar versions got truncated.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/recipeutils.py

index 9d45b4216e020566fd060271ca1f3b41cb7f698f..cd742130de3dea1b746fd80703d375cf579229b4 100644 (file)
@@ -638,7 +638,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
     sfx = ''
 
     if uri_type == 'git':
-        git_regex = re.compile("(?P<pfx>(v|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
+        git_regex = re.compile("(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?")
         m = git_regex.match(pv)
 
         if m:
@@ -646,7 +646,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
             pfx = m.group('pfx')
             sfx = m.group('sfx')
     else:
-        regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))")
+        regex = re.compile("(?P<pfx>(v|r)?)(?P<ver>.*)")
         m = regex.match(pv)
         if m:
             pv = m.group('ver')