diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/lib/compatlayer/__init__.py | 29 | ||||
| -rwxr-xr-x | scripts/yocto-compat-layer.py | 21 |
2 files changed, 41 insertions, 9 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 | ||
| 135 | def add_layer(bblayersconf, layer): | 135 | def _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 | |||
| 142 | def 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 | |||
| 139 | def get_signatures(builddir, failsafe=False): | 166 | def get_signatures(builddir, failsafe=False): |
| 140 | import subprocess | 167 | import subprocess |
| 141 | import re | 168 | import re |
diff --git a/scripts/yocto-compat-layer.py b/scripts/yocto-compat-layer.py index b4de84a0a5..9e74033340 100755 --- a/scripts/yocto-compat-layer.py +++ b/scripts/yocto-compat-layer.py | |||
| @@ -116,6 +116,7 @@ def main(): | |||
| 116 | td['sigs'] = get_signatures(td['builddir']) | 116 | td['sigs'] = get_signatures(td['builddir']) |
| 117 | logger.info('') | 117 | logger.info('') |
| 118 | 118 | ||
| 119 | layers_tested = 0 | ||
| 119 | for layer in layers: | 120 | for layer in layers: |
| 120 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ | 121 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ |
| 121 | layer['type'] == LayerType.ERROR_BSP_DISTRO: | 122 | layer['type'] == LayerType.ERROR_BSP_DISTRO: |
| @@ -123,16 +124,20 @@ def main(): | |||
| 123 | 124 | ||
| 124 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) | 125 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) |
| 125 | 126 | ||
| 126 | add_layer(bblayersconf, layer) | 127 | if not add_layer(bblayersconf, layer, layers, logger): |
| 128 | continue | ||
| 129 | |||
| 127 | result = test_layer_compatibility(td, layer) | 130 | result = test_layer_compatibility(td, layer) |
| 128 | results[layer['name']] = result | 131 | results[layer['name']] = result |
| 129 | 132 | layers_tested = layers_tested + 1 | |
| 130 | logger.info('') | 133 | |
| 131 | logger.info('Summary of results:') | 134 | if layers_tested: |
| 132 | logger.info('') | 135 | logger.info('') |
| 133 | for layer_name in results: | 136 | logger.info('Summary of results:') |
| 134 | logger.info('%s ... %s' % (layer_name, 'PASS' if \ | 137 | logger.info('') |
| 135 | results[layer_name].wasSuccessful() else 'FAIL')) | 138 | for layer_name in results: |
| 139 | logger.info('%s ... %s' % (layer_name, 'PASS' if \ | ||
| 140 | results[layer_name].wasSuccessful() else 'FAIL')) | ||
| 136 | 141 | ||
| 137 | cleanup_bblayers(None, None) | 142 | cleanup_bblayers(None, None) |
| 138 | 143 | ||
