rrs_upstream_history: fix get_recipe_pv_without_srcpv

The get_recipe_pv_without_srcpv function was renamed to
get_recipe_pv_with_pfx_sfx in:

84794b59 lib/oe/recipeutils.py: accommodate SRCPV being optional and deprecated in version check regex

Try to import/call the old method and fail over to the new method.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
This commit is contained in:
Tim Orling 2024-01-09 11:39:01 -08:00
parent eeefc7c341
commit 288b2eeba4

View File

@ -87,8 +87,11 @@ def set_regexes(d):
def get_upstream_info(layerbranch, recipe_data, result):
from bb.utils import vercmp_string
from oe.recipeutils import get_recipe_upstream_version, \
get_recipe_pv_without_srcpv
from oe.recipeutils import get_recipe_upstream_version
try:
from oe.recipeutils import get_recipe_pv_without_srcpv
except ImportError:
from oe.recipeutils import get_recipe_pv_with_pfx_sfx
pn = recipe_data.getVar('PN', True)
@ -109,10 +112,16 @@ def get_upstream_info(layerbranch, recipe_data, result):
ru.type = ru_info['type']
ru.date = ru_info['datetime']
pv, _, _ = get_recipe_pv_without_srcpv(recipe_pv,
get_pv_type(recipe_pv))
upv, _, _ = get_recipe_pv_without_srcpv(ru_info['version'],
get_pv_type(ru_info['version']))
try:
pv, _, _ = get_recipe_pv_without_srcpv(recipe_pv,
get_pv_type(recipe_pv))
upv, _, _ = get_recipe_pv_without_srcpv(ru_info['version'],
get_pv_type(ru_info['version']))
except NameError:
pv, _, _ = get_recipe_pv_with_pfx_sfx(recipe_pv,
get_pv_type(recipe_pv))
upv, _, _ = get_recipe_pv_with_pfx_sfx(ru_info['version'],
get_pv_type(ru_info['version']))
if pv and upv:
cmp_ver = vercmp_string(pv, upv)