summaryrefslogtreecommitdiffstats
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-22 11:35:22 +0000
commitf57eac5dc9253ea2bf769011b8be29d3fff9fdd1 (patch)
tree47c5d279fa2402eded65546e491ce1bbdb5808f4 /scripts/lib
parent4703aa2b3ba25f463826f9f6eb38b69fa649b572 (diff)
downloadpoky-f57eac5dc9253ea2bf769011b8be29d3fff9fdd1.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. (From OE-Core rev: 1e7cf9bb71521f1632dd2e6b01fe7fcc95732983) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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):
132 132
133 return layers 133 return layers
134 134
135def add_layer(bblayersconf, layer): 135def _find_layer_depends(depend, layers):
136 for layer in layers:
137 for collection in layer['collections']:
138 if depend == collection:
139 return layer
140 return None
141
142def add_layer(bblayersconf, layer, layers, logger):
143 logger.info('Adding layer %s' % layer['name'])
144
145 for collection in layer['collections']:
146 for depend in layer['collections'][collection]['depends'].split():
147 # core (oe-core) is suppose to be provided
148 if depend == 'core':
149 continue
150
151 layer_depend = _find_layer_depends(depend, layers)
152 if not layer_depend:
153 logger.error('Layer %s depends on %s and isn\'t found.' % \
154 (layer['name'], depend))
155 return False
156
157 logger.info('Adding layer dependency %s' % layer_depend['name'])
158 with open(bblayersconf, 'a+') as f:
159 f.write("\nBBLAYERS += \"%s\"\n" % layer_depend['path'])
160
136 with open(bblayersconf, 'a+') as f: 161 with open(bblayersconf, 'a+') as f:
137 f.write("\nBBLAYERS += \"%s\"\n" % layer['path']) 162 f.write("\nBBLAYERS += \"%s\"\n" % layer['path'])
138 163
164 return True
165
139def get_signatures(builddir, failsafe=False): 166def get_signatures(builddir, failsafe=False):
140 import subprocess 167 import subprocess
141 import re 168 import re