aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-03-20 17:33:26 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-21 22:43:05 +0000
commit1e7cf9bb71521f1632dd2e6b01fe7fcc95732983 (patch)
tree9dcf9d98dccdabba65e00ebeed8ee94a9c513eba /scripts/lib
parentf2f6f0c938226802163698ef14a8a9103da362a0 (diff)
downloadopenembedded-core-contrib-1e7cf9bb71521f1632dd2e6b01fe7fcc95732983.tar.gz
scripts/yocto-compat-layer.py: Handle layer dependencies when test
If some layer depends on other tries to find layer dependency, if the layer dependency isn't found avoid to test the layer and notice the user. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/compatlayer/__init__.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py
index b8ce771319..435679edbf 100644
--- a/scripts/lib/compatlayer/__init__.py
+++ b/scripts/lib/compatlayer/__init__.py
@@ -132,10 +132,37 @@ def detect_layers(layer_directories, no_auto):
return layers
-def add_layer(bblayersconf, layer):
+def _find_layer_depends(depend, layers):
+ for layer in layers:
+ for collection in layer['collections']:
+ if depend == collection:
+ return layer
+ return None
+
+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():
+ # core (oe-core) is suppose to be provided
+ if depend == 'core':
+ continue
+
+ layer_depend = _find_layer_depends(depend, layers)
+ if not layer_depend:
+ logger.error('Layer %s depends on %s and isn\'t found.' % \
+ (layer['name'], depend))
+ return False
+
+ logger.info('Adding layer dependency %s' % layer_depend['name'])
+ with open(bblayersconf, 'a+') as f:
+ f.write("\nBBLAYERS += \"%s\"\n" % layer_depend['path'])
+
with open(bblayersconf, 'a+') as f:
f.write("\nBBLAYERS += \"%s\"\n" % layer['path'])
+ return True
+
def get_signatures(builddir, failsafe=False):
import subprocess
import re