From e81daf2e0fbcd38fae1a7ad1b629c97fdae25f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Tue, 14 Jul 2015 18:29:49 -0500 Subject: [PATCH] rrs/tools: get_recipe_pv_without_srcrev add support for discard prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid version prefixes like v|r into all versions. Signed-off-by: Aníbal Limón --- rrs/tools/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rrs/tools/common.py b/rrs/tools/common.py index 01c4785..32fce45 100644 --- a/rrs/tools/common.py +++ b/rrs/tools/common.py @@ -144,12 +144,18 @@ def get_recipe_pv_without_srcpv(pv, uri_type): sfx = '' if uri_type == 'git': - git_regex = re.compile("(?P(v|))(?P((\d+[\.\-_]*)+))(?P(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P.*)") + git_regex = re.compile("(?P(v|r|))(?P((\d+[\.\-_]*)+))(?P(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P.*)") m = git_regex.match(pv) if m: pv = m.group('ver') pfx = m.group('pfx') sfx = m.group('sfx') + else: + regex = re.compile("(?P(v|r|))(?P((\d+[\.\-_]*)+))") + m = regex.match(pv) + if m: + pv = m.group('ver') + pfx = m.group('pfx') return (pv, pfx, sfx)