mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 18:49:32 +02:00
recipeutils: Improve get_recipe_pv_without_srcpv function
Use pv instead of rd this make the function more generic and avoid copy recipe data. (From OE-Core rev: c1c3c9a4fbaf01a905f79b0970f98ccb221a3935) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
9634494087
commit
a8c746743e
@@ -626,23 +626,17 @@ def replace_dir_vars(path, d):
|
|||||||
path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
|
path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def get_recipe_pv_without_srcpv(rd, uri_type):
|
def get_recipe_pv_without_srcpv(pv, uri_type):
|
||||||
"""
|
"""
|
||||||
Get PV without SRCPV common in SCM's for now only
|
Get PV without SRCPV common in SCM's for now only
|
||||||
support git.
|
support git.
|
||||||
|
|
||||||
Returns tuple with pv, prefix and suffix.
|
Returns tuple with pv, prefix and suffix.
|
||||||
"""
|
"""
|
||||||
pv = ''
|
|
||||||
pfx = ''
|
pfx = ''
|
||||||
sfx = ''
|
sfx = ''
|
||||||
|
|
||||||
if uri_type == 'git':
|
if uri_type == 'git':
|
||||||
rd_tmp = rd.createCopy()
|
|
||||||
|
|
||||||
rd_tmp.setVar('SRCPV', '')
|
|
||||||
pv = rd_tmp.getVar('PV', True)
|
|
||||||
|
|
||||||
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>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
|
||||||
m = git_regex.match(pv)
|
m = git_regex.match(pv)
|
||||||
|
|
||||||
@@ -650,8 +644,6 @@ def get_recipe_pv_without_srcpv(rd, uri_type):
|
|||||||
pv = m.group('ver')
|
pv = m.group('ver')
|
||||||
pfx = m.group('pfx')
|
pfx = m.group('pfx')
|
||||||
sfx = m.group('sfx')
|
sfx = m.group('sfx')
|
||||||
else:
|
|
||||||
pv = rd.getVar('PV', True)
|
|
||||||
|
|
||||||
return (pv, pfx, sfx)
|
return (pv, pfx, sfx)
|
||||||
|
|
||||||
@@ -704,7 +696,7 @@ def get_recipe_upstream_version(rd):
|
|||||||
pupver = ud.method.latest_versionstring(ud, rd)
|
pupver = ud.method.latest_versionstring(ud, rd)
|
||||||
|
|
||||||
if uri_type == 'git':
|
if uri_type == 'git':
|
||||||
(pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd, uri_type)
|
(pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
|
||||||
|
|
||||||
latest_revision = ud.method.latest_revision(ud, rd, ud.names[0])
|
latest_revision = ud.method.latest_revision(ud, rd, ud.names[0])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user