summaryrefslogtreecommitdiffstats
path: root/scripts/lib/compatlayer/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/compatlayer/__init__.py')
-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