summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2017-03-30 21:30:29 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-05 12:36:44 +0100
commit4eb0932e755b7cb582a8db811aeed1397ecb92cc (patch)
tree90ca0bcfaad35bf82a7caaf1b0723dd78ddd5f2e
parent6e0a268b750fb6701604dd936cd2cf3b47a6e804 (diff)
downloadopenembedded-core-4eb0932e755b7cb582a8db811aeed1397ecb92cc.tar.gz
openembedded-core-4eb0932e755b7cb582a8db811aeed1397ecb92cc.tar.bz2
openembedded-core-4eb0932e755b7cb582a8db811aeed1397ecb92cc.zip
yocto-compat-layer.py: Fix the signature validation
The initial signatures need to be collected -after- the dependency layers have been added to the system. Otherwise changes that happen due to dependencies, outside of the layer being scanned, will show up as signature problems. The add_layer function was split into two pieces so that we can process the dependencies first, and then add the layer itself for the comparison. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--scripts/lib/compatlayer/__init__.py7
-rwxr-xr-xscripts/yocto-compat-layer.py29
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):
return layer
return None
-def add_layer(bblayersconf, layer, layers, logger):
- logger.info('Adding layer %s' % layer['name'])
-
+def add_layer_dependencies(bblayersconf, layer, layers, logger):
def recurse_dependencies(depends, layer, layers, logger, ret = []):
logger.debug('Processing dependencies %s for layer %s.' % \
(depends, layer['name']))
@@ -192,7 +190,10 @@ def add_layer(bblayersconf, layer, layers, logger):
logger.info('Adding layer dependency %s' % layer_depend['name'])
with open(bblayersconf, 'a+') as f:
f.write("\nBBLAYERS += \"%s\"\n" % layer_depend['path'])
+ return True
+def add_layer(bblayersconf, layer, layers, logger):
+ logger.info('Adding layer %s' % layer['name'])
with open(bblayersconf, 'a+') as f:
f.write("\nBBLAYERS += \"%s\"\n" % layer['path'])
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
scriptpath.add_oe_lib_path()
scriptpath.add_bitbake_lib_path()
-from compatlayer import LayerType, detect_layers, add_layer, get_signatures
+from compatlayer import LayerType, detect_layers, add_layer, add_layer_dependencies, get_signatures
from oeqa.utils.commands import get_bb_vars
PROGNAME = 'yocto-compat-layer'
@@ -116,29 +116,38 @@ def main():
results = collections.OrderedDict()
results_status = collections.OrderedDict()
- logger.info('')
- logger.info('Getting initial bitbake variables ...')
- td['bbvars'] = get_bb_vars()
- logger.info('Getting initial signatures ...')
- td['builddir'] = builddir
- td['sigs'] = get_signatures(td['builddir'])
- logger.info('')
-
layers_tested = 0
for layer in layers:
if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \
layer['type'] == LayerType.ERROR_BSP_DISTRO:
continue
+ logger.info('')
+ logger.info("Setting up for %s(%s), %s" % (layer['name'], layer['type'],
+ layer['path']))
+
shutil.copyfile(bblayersconf + '.backup', bblayersconf)
- if not add_layer(bblayersconf, layer, dep_layers, logger):
+ if not add_layer_dependencies(bblayersconf, layer, dep_layers, logger):
logger.info('Skipping %s due to missing dependencies.' % layer['name'])
results[layer['name']] = None
results_status[layer['name']] = 'SKIPPED (Missing dependencies)'
layers_tested = layers_tested + 1
continue
+ logger.info('Getting initial bitbake variables ...')
+ td['bbvars'] = get_bb_vars()
+ logger.info('Getting initial signatures ...')
+ td['builddir'] = builddir
+ td['sigs'] = get_signatures(td['builddir'])
+
+ if not add_layer(bblayersconf, layer, dep_layers, logger):
+ logger.info('Skipping %s ???.' % layer['name'])
+ results[layer['name']] = None
+ results_status[layer['name']] = 'SKIPPED (Unknown)'
+ layers_tested = layers_tested + 1
+ continue
+
result = test_layer_compatibility(td, layer)
results[layer['name']] = result
results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL'