aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/tools
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-30 17:05:52 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-31 08:57:37 +1200
commit00bae9978dda09f859a26756263b8f38ea94edd4 (patch)
treeca92c8d4cff4a41f739163d8f91bf219a1d12861 /layerindex/tools
parent3cc87cff7755d8efdbdab661cc08b75a20da400a (diff)
downloadopenembedded-core-contrib-00bae9978dda09f859a26756263b8f38ea94edd4.tar.gz
update_layer.py: fix up for bitbake API change
The multiconfig changes broke the calls here to loadDataFull(). To avoid this being an issue in future, make use of tinfoil's new parse_recipe_file() function (if available) to isolate the code here from any future changes to bitbake's internal code. Part of the fix for [YOCTO #10192]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/tools')
-rwxr-xr-xlayerindex/tools/import_classic.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/layerindex/tools/import_classic.py b/layerindex/tools/import_classic.py
index ee9924616a..45ccaa9c19 100755
--- a/layerindex/tools/import_classic.py
+++ b/layerindex/tools/import_classic.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Import OE-Classic recipe data into the layer index database
#
@@ -27,11 +27,14 @@ import recipeparse
logger = utils.logger_create('LayerIndexUpdate')
-def update_recipe_file(data, path, recipe, layerdir_start, repodir):
+def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
fn = str(os.path.join(path, recipe.filename))
try:
logger.debug('Updating recipe %s' % fn)
- envdata = bb.cache.Cache.loadDataFull(fn, [], data)
+ if hasattr(tinfoil, 'parse_recipe_file'):
+ envdata = tinfoil.parse_recipe_file(fn, appends=False, config_data=data)
+ else:
+ envdata = bb.cache.Cache.loadDataFull(fn, [], data)
envdata.setVar('SRCPV', 'X')
envdata.setVar('SRCDATE', 'X')
envdata.setVar('SRCREV', 'X')
@@ -182,7 +185,7 @@ def main():
recipe.layerbranch = layerbranch
recipe.filename = filename
recipe.filepath = filepath
- update_recipe_file(config_data_copy, root, recipe, layerdir_start, oeclassicpath)
+ update_recipe_file(tinfoil, config_data_copy, root, recipe, layerdir_start, oeclassicpath)
recipe.save()
layerbranch.vcs_last_fetch = datetime.now()