mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
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>
This commit is contained in:
parent
81e3086f4c
commit
410569a701
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# Import OE-Classic recipe data into the layer index database
|
# Import OE-Classic recipe data into the layer index database
|
||||||
#
|
#
|
||||||
|
@ -27,10 +27,13 @@ import recipeparse
|
||||||
logger = utils.logger_create('LayerIndexUpdate')
|
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))
|
fn = str(os.path.join(path, recipe.filename))
|
||||||
try:
|
try:
|
||||||
logger.debug('Updating recipe %s' % fn)
|
logger.debug('Updating recipe %s' % fn)
|
||||||
|
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 = bb.cache.Cache.loadDataFull(fn, [], data)
|
||||||
envdata.setVar('SRCPV', 'X')
|
envdata.setVar('SRCPV', 'X')
|
||||||
envdata.setVar('SRCDATE', 'X')
|
envdata.setVar('SRCDATE', 'X')
|
||||||
|
@ -182,7 +185,7 @@ def main():
|
||||||
recipe.layerbranch = layerbranch
|
recipe.layerbranch = layerbranch
|
||||||
recipe.filename = filename
|
recipe.filename = filename
|
||||||
recipe.filepath = filepath
|
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()
|
recipe.save()
|
||||||
|
|
||||||
layerbranch.vcs_last_fetch = datetime.now()
|
layerbranch.vcs_last_fetch = datetime.now()
|
||||||
|
|
|
@ -58,7 +58,10 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
|
||||||
fn = str(os.path.join(path, recipe.filename))
|
fn = str(os.path.join(path, recipe.filename))
|
||||||
try:
|
try:
|
||||||
logger.debug('Updating recipe %s' % fn)
|
logger.debug('Updating recipe %s' % fn)
|
||||||
envdata = tinfoil.cache.loadDataFull(fn, [])
|
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('SRCPV', 'X')
|
||||||
recipe.pn = envdata.getVar("PN", True)
|
recipe.pn = envdata.getVar("PN", True)
|
||||||
recipe.pv = envdata.getVar("PV", True)
|
recipe.pv = envdata.getVar("PV", True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user