Skip to contentSkip to conversation

devtool: Support variables in SRC_URI when upgrading recipes

PATCH In review Frieder Schrempf 2 participants 2 messages Sep 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devtool: Support variables in SRC_URI when upgrading recipes

From: Frieder Schrempf <[email protected]>

Currently when upgrading recipes SRC_URI doesn't get expanded which can lead to failures if variables are used in SRC_URI. Remove this limitation by always expanding SRC_URI.

---
 scripts/lib/devtool/standard.py | 4 ++--
 scripts/lib/devtool/upgrade.py  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
scripts/lib/devtool/standard.py +2 -2
index 1fd5947c41..9e8889f897 100644
@@ -1540,7 +1540,7 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi
     remove_files = []
     patchfields = {}
     patchfields['SRCREV'] = srcrev
-    orig_src_uri = rd.getVar('SRC_URI', False) or ''
+    orig_src_uri = rd.getVar('SRC_URI') or ''
     srcuri = orig_src_uri.split()
     tempdir = tempfile.mkdtemp(prefix='devtool')
     update_srcuri = False
@@ -1672,7 +1672,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
         updatefiles = False
         updaterecipe = False
         destpath = None
-        srcuri = (rd.getVar('SRC_URI', False) or '').split()
+        srcuri = (rd.getVar('SRC_URI') or '').split()
 
         if appendlayerdir:
             files = OrderedDict((os.path.join(local_files_dir, key), val) for
scripts/lib/devtool/upgrade.py +1 -1
index dda0a58098..6df53b0232 100644
@@ -359,7 +359,7 @@ def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsu
         newvalues['SRCREV'] = srcrev
 
     if srcbranch:
-        src_uri = oe.recipeutils.split_var_value(rd.getVar('SRC_URI', False) or '')
+        src_uri = oe.recipeutils.split_var_value(rd.getVar('SRC_URI') or '')
         changed = False
         replacing = True
         new_src_uri = []
Signature · 1 line
2.51.0
#1 lore raw

Am 16.09.25 um 12:09 schrieb Frieder Schrempf:

Quoted 5 lines

From: Frieder Schrempf <[email protected]>

Currently when upgrading recipes SRC_URI doesn't get expanded which can lead to failures if variables are used in SRC_URI. Remove this limitation by always expanding SRC_URI.

Hm, it seems like it already works on master without this patch (no idea why as this still uses getVar('SRC_URI', False). But on Scarthgap I'm getting:

ERROR: Could not decode SRC_URI: The URL: '${SRC_URI_PLATFORM_BSP}' is invalid and cannot be interpreted

Quoted 42 lines
---
 scripts/lib/devtool/standard.py | 4 ++--
 scripts/lib/devtool/upgrade.py  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
scripts/lib/devtool/standard.py +2 -2
index 1fd5947c41..9e8889f897 100644
@@ -1540,7 +1540,7 @@ def _update_recipe_srcrev(recipename, workspace, srctree, rd, appendlayerdir, wi
     remove_files = []
     patchfields = {}
     patchfields['SRCREV'] = srcrev
-    orig_src_uri = rd.getVar('SRC_URI', False) or ''
+    orig_src_uri = rd.getVar('SRC_URI') or ''
     srcuri = orig_src_uri.split()
     tempdir = tempfile.mkdtemp(prefix='devtool')
     update_srcuri = False
@@ -1672,7 +1672,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil
         updatefiles = False
         updaterecipe = False
         destpath = None
-        srcuri = (rd.getVar('SRC_URI', False) or '').split()
+        srcuri = (rd.getVar('SRC_URI') or '').split()
 
         if appendlayerdir:
             files = OrderedDict((os.path.join(local_files_dir, key), val) for
scripts/lib/devtool/upgrade.py +1 -1
index dda0a58098..6df53b0232 100644
@@ -359,7 +359,7 @@ def _create_new_recipe(newpv, checksums, srcrev, srcbranch, srcsubdir_old, srcsu
         newvalues['SRCREV'] = srcrev
 
     if srcbranch:
-        src_uri = oe.recipeutils.split_var_value(rd.getVar('SRC_URI', False) or '')
+        src_uri = oe.recipeutils.split_var_value(rd.getVar('SRC_URI') or '')
         changed = False
         replacing = True
         new_src_uri = []