aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/update_layer.py
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/update_layer.py
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/update_layer.py')
-rw-r--r--layerindex/update_layer.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index fd8d3d4fa3..13b508f79d 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -54,11 +54,14 @@ def split_recipe_fn(path):
pv = "1.0"
return (pn, pv)
-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')
recipe.pn = envdata.getVar("PN", True)
recipe.pv = envdata.getVar("PV", True)
@@ -356,7 +359,7 @@ def main():
recipe.filepath = newfilepath
recipe.filename = newfilename
recipe.save()
- update_recipe_file(config_data_copy, os.path.join(layerdir, newfilepath), recipe, layerdir_start, repodir)
+ update_recipe_file(tinfoil, config_data_copy, os.path.join(layerdir, newfilepath), recipe, layerdir_start, repodir)
updatedrecipes.add(os.path.join(oldfilepath, oldfilename))
updatedrecipes.add(os.path.join(newfilepath, newfilename))
else:
@@ -471,7 +474,7 @@ def main():
results = layerrecipes.filter(filepath=filepath).filter(filename=filename)[:1]
if results:
recipe = results[0]
- update_recipe_file(config_data_copy, os.path.join(layerdir, filepath), recipe, layerdir_start, repodir)
+ update_recipe_file(tinfoil, config_data_copy, os.path.join(layerdir, filepath), recipe, layerdir_start, repodir)
recipe.save()
updatedrecipes.add(recipe.full_path())
elif typename == 'machine':
@@ -487,7 +490,7 @@ def main():
for recipe in dirtyrecipes:
if not recipe.full_path() in updatedrecipes:
- update_recipe_file(config_data_copy, os.path.join(layerdir, recipe.filepath), recipe, layerdir_start, repodir)
+ update_recipe_file(tinfoil, config_data_copy, os.path.join(layerdir, recipe.filepath), recipe, layerdir_start, repodir)
else:
# Collect recipe data from scratch
@@ -513,7 +516,7 @@ def main():
# Recipe still exists, update it
results = layerrecipes.filter(id=v['id'])[:1]
recipe = results[0]
- update_recipe_file(config_data_copy, root, recipe, layerdir_start, repodir)
+ update_recipe_file(tinfoil, config_data_copy, root, recipe, layerdir_start, repodir)
else:
# Recipe no longer exists, mark it for later on
layerrecipes_delete.append(v)
@@ -575,7 +578,7 @@ def main():
recipe.filename = os.path.basename(added)
root = os.path.dirname(added)
recipe.filepath = os.path.relpath(root, layerdir)
- update_recipe_file(config_data_copy, root, recipe, layerdir_start, repodir)
+ update_recipe_file(tinfoil, config_data_copy, root, recipe, layerdir_start, repodir)
recipe.save()
for deleted in layerrecipes_delete: