[yocto] [layerindex-web][PATCH 4/7] recipeparse: don't error out on missing layer recommends

Paul Eggleton paul.eggleton at linux.intel.com
Mon Jul 2 15:58:48 PDT 2018


If a LAYERRECOMMENDS relationship is not satisfied, we shouldn't be
erroring out - it's a recommendation, not a hard dependency. Just show a
warning and allow processing to continue.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 layerindex/recipeparse.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/layerindex/recipeparse.py b/layerindex/recipeparse.py
index f1c1bd32..bc8a19ef 100644
--- a/layerindex/recipeparse.py
+++ b/layerindex/recipeparse.py
@@ -102,7 +102,11 @@ def setup_layer(config_data, fetchdir, layerdir, layer, layerbranch):
         deprepodir = os.path.join(fetchdir, depurldir)
         deplayerbranch = dep.dependency.get_layerbranch(layerbranch.branch.name)
         if not deplayerbranch:
-            raise RecipeParseError('Dependency %s of layer %s does not have branch record for branch %s' % (dep.dependency.name, layer.name, layerbranch.branch.name))
+            if dep.required:
+                raise RecipeParseError('Dependency %s of layer %s does not have branch record for branch %s' % (dep.dependency.name, layer.name, layerbranch.branch.name))
+            else:
+                logger.warning('Recommends %s of layer %s does not have branch record for branch %s - ignoring' % (dep.dependency.name, layer.name, layerbranch.branch.name))
+                continue
         deplayerdir = os.path.join(deprepodir, deplayerbranch.vcs_subdir)
         utils.parse_layer_conf(deplayerdir, config_data_copy)
     config_data_copy.delVar('LAYERDIR')
-- 
2.17.1



More information about the yocto mailing list