diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/compatlayer/__init__.py | 7 | ||||
-rwxr-xr-x | scripts/yocto-compat-layer.py | 29 |
2 files changed, 23 insertions, 13 deletions
diff --git a/scripts/lib/compatlayer/__init__.py b/scripts/lib/compatlayer/__init__.py index 8d8bdfe939..86f86eb657 100644 --- a/scripts/lib/compatlayer/__init__.py +++ b/scripts/lib/compatlayer/__init__.py | |||
@@ -140,9 +140,7 @@ def _find_layer_depends(depend, layers): | |||
140 | return layer | 140 | return layer |
141 | return None | 141 | return None |
142 | 142 | ||
143 | def add_layer(bblayersconf, layer, layers, logger): | 143 | def add_layer_dependencies(bblayersconf, layer, layers, logger): |
144 | logger.info('Adding layer %s' % layer['name']) | ||
145 | |||
146 | def recurse_dependencies(depends, layer, layers, logger, ret = []): | 144 | def recurse_dependencies(depends, layer, layers, logger, ret = []): |
147 | logger.debug('Processing dependencies %s for layer %s.' % \ | 145 | logger.debug('Processing dependencies %s for layer %s.' % \ |
148 | (depends, layer['name'])) | 146 | (depends, layer['name'])) |
@@ -192,7 +190,10 @@ def add_layer(bblayersconf, layer, layers, logger): | |||
192 | logger.info('Adding layer dependency %s' % layer_depend['name']) | 190 | logger.info('Adding layer dependency %s' % layer_depend['name']) |
193 | with open(bblayersconf, 'a+') as f: | 191 | with open(bblayersconf, 'a+') as f: |
194 | f.write("\nBBLAYERS += \"%s\"\n" % layer_depend['path']) | 192 | f.write("\nBBLAYERS += \"%s\"\n" % layer_depend['path']) |
193 | return True | ||
195 | 194 | ||
195 | def add_layer(bblayersconf, layer, layers, logger): | ||
196 | logger.info('Adding layer %s' % layer['name']) | ||
196 | with open(bblayersconf, 'a+') as f: | 197 | with open(bblayersconf, 'a+') as f: |
197 | f.write("\nBBLAYERS += \"%s\"\n" % layer['path']) | 198 | f.write("\nBBLAYERS += \"%s\"\n" % layer['path']) |
198 | 199 | ||
diff --git a/scripts/yocto-compat-layer.py b/scripts/yocto-compat-layer.py index f8a1ac7468..22c0c2ddea 100755 --- a/scripts/yocto-compat-layer.py +++ b/scripts/yocto-compat-layer.py | |||
@@ -22,7 +22,7 @@ import scriptpath | |||
22 | scriptpath.add_oe_lib_path() | 22 | scriptpath.add_oe_lib_path() |
23 | scriptpath.add_bitbake_lib_path() | 23 | scriptpath.add_bitbake_lib_path() |
24 | 24 | ||
25 | from compatlayer import LayerType, detect_layers, add_layer, get_signatures | 25 | from compatlayer import LayerType, detect_layers, add_layer, add_layer_dependencies, get_signatures |
26 | from oeqa.utils.commands import get_bb_vars | 26 | from oeqa.utils.commands import get_bb_vars |
27 | 27 | ||
28 | PROGNAME = 'yocto-compat-layer' | 28 | PROGNAME = 'yocto-compat-layer' |
@@ -116,29 +116,38 @@ def main(): | |||
116 | results = collections.OrderedDict() | 116 | results = collections.OrderedDict() |
117 | results_status = collections.OrderedDict() | 117 | results_status = collections.OrderedDict() |
118 | 118 | ||
119 | logger.info('') | ||
120 | logger.info('Getting initial bitbake variables ...') | ||
121 | td['bbvars'] = get_bb_vars() | ||
122 | logger.info('Getting initial signatures ...') | ||
123 | td['builddir'] = builddir | ||
124 | td['sigs'] = get_signatures(td['builddir']) | ||
125 | logger.info('') | ||
126 | |||
127 | layers_tested = 0 | 119 | layers_tested = 0 |
128 | for layer in layers: | 120 | for layer in layers: |
129 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ | 121 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ |
130 | layer['type'] == LayerType.ERROR_BSP_DISTRO: | 122 | layer['type'] == LayerType.ERROR_BSP_DISTRO: |
131 | continue | 123 | continue |
132 | 124 | ||
125 | logger.info('') | ||
126 | logger.info("Setting up for %s(%s), %s" % (layer['name'], layer['type'], | ||
127 | layer['path'])) | ||
128 | |||
133 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) | 129 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) |
134 | 130 | ||
135 | if not add_layer(bblayersconf, layer, dep_layers, logger): | 131 | if not add_layer_dependencies(bblayersconf, layer, dep_layers, logger): |
136 | logger.info('Skipping %s due to missing dependencies.' % layer['name']) | 132 | logger.info('Skipping %s due to missing dependencies.' % layer['name']) |
137 | results[layer['name']] = None | 133 | results[layer['name']] = None |
138 | results_status[layer['name']] = 'SKIPPED (Missing dependencies)' | 134 | results_status[layer['name']] = 'SKIPPED (Missing dependencies)' |
139 | layers_tested = layers_tested + 1 | 135 | layers_tested = layers_tested + 1 |
140 | continue | 136 | continue |
141 | 137 | ||
138 | logger.info('Getting initial bitbake variables ...') | ||
139 | td['bbvars'] = get_bb_vars() | ||
140 | logger.info('Getting initial signatures ...') | ||
141 | td['builddir'] = builddir | ||
142 | td['sigs'] = get_signatures(td['builddir']) | ||
143 | |||
144 | if not add_layer(bblayersconf, layer, dep_layers, logger): | ||
145 | logger.info('Skipping %s ???.' % layer['name']) | ||
146 | results[layer['name']] = None | ||
147 | results_status[layer['name']] = 'SKIPPED (Unknown)' | ||
148 | layers_tested = layers_tested + 1 | ||
149 | continue | ||
150 | |||
142 | result = test_layer_compatibility(td, layer) | 151 | result = test_layer_compatibility(td, layer) |
143 | results[layer['name']] = result | 152 | results[layer['name']] = result |
144 | results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL' | 153 | results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL' |