From d3e4f25993cc784efc61c69a9c25daf5f89102bb Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Fri, 25 Aug 2023 12:41:57 +0200 Subject: lib/oe/recipeutils.py: accommodate SRCPV being optional and deprecated in version check regex (From OE-Core rev: 84794b59940cb08ec44e5ee7718a464d24136812) Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/lib/oe/recipeutils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'meta/lib/oe/recipeutils.py') diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index 6996e426ec..3336db8ab0 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py @@ -945,10 +945,9 @@ def replace_dir_vars(path, d): path = path.replace(dirpath, '${%s}' % dirvars[dirpath]) return path -def get_recipe_pv_without_srcpv(pv, uri_type): +def get_recipe_pv_with_pfx_sfx(pv, uri_type): """ - Get PV without SRCPV common in SCM's for now only - support git. + Get PV separating prefix and suffix components. Returns tuple with pv, prefix and suffix. """ @@ -956,7 +955,7 @@ def get_recipe_pv_without_srcpv(pv, uri_type): sfx = '' if uri_type == 'git': - git_regex = re.compile(r"(?Pv?)(?P.*?)(?P\+[^\+]*(git)?r?(AUTOINC\+))(?P.*)") + git_regex = re.compile(r"(?Pv?)(?P.*?)(?P\+[^\+]*(git)?r?(AUTOINC\+)?)(?P.*)") m = git_regex.match(pv) if m: @@ -1008,7 +1007,7 @@ def get_recipe_upstream_version(rd): src_uri = src_uris.split()[0] uri_type, _, _, _, _, _ = decodeurl(src_uri) - (pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd.getVar('PV'), uri_type) + (pv, pfx, sfx) = get_recipe_pv_with_pfx_sfx(rd.getVar('PV'), uri_type) ru['current_version'] = pv manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION") -- cgit v1.2.3-54-g00ecf