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.orl...@konsulko.com>
---
 rrs/tools/rrs_upstream_history.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/rrs/tools/rrs_upstream_history.py 
b/rrs/tools/rrs_upstream_history.py
index 25f4b20..bf32c5d 100755
--- a/rrs/tools/rrs_upstream_history.py
+++ b/rrs/tools/rrs_upstream_history.py
@@ -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)
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62158): https://lists.yoctoproject.org/g/yocto/message/62158
Mute This Topic: https://lists.yoctoproject.org/mt/103744907/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to