Skip to contentSkip to conversation

scripts/yocto-compat-layer.py: Add dependency validation in add_layer

PATCH New Aníbal Limón 1 participant 1 message Mar 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/yocto-compat-layer.py: Add dependency validation in add_layer

Some layers don't have dependencies so add a validation to avoid exception when trying to None.split().

---
 scripts/lib/compatlayer/__init__.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/lib/compatlayer/__init__.py +5 -1
index 435679e..58f94b7 100644
@@ -143,7 +143,11 @@ def add_layer(bblayersconf, layer, layers, logger):
     logger.info('Adding layer %s' % layer['name'])
 
     for collection in layer['collections']:
-        for depend in layer['collections'][collection]['depends'].split():
+        depends = layer['collections'][collection]['depends']
+        if not depends:
+            continue
+
+        for depend in depends.split():
             # core (oe-core) is suppose to be provided
             if depend == 'core':
                 continue
Signature · 1 line
2.1.4