From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Cc: saul.wold@intel.com
Subject: [PATCH 4/4] yocto-compat-layer.py: Fix the signature validation
Date: Thu, 30 Mar 2017 21:30:29 -0500 [thread overview]
Message-ID: <1490927429-48266-5-git-send-email-mark.hatle@windriver.com> (raw)
In-Reply-To: <1490927429-48266-1-git-send-email-mark.hatle@windriver.com>
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>
---
scripts/lib/compatlayer/__init__.py | 7 ++++---
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 24edc88..06c84f4 100644
--- a/scripts/lib/compatlayer/__init__.py
+++ b/scripts/lib/compatlayer/__init__.py
@@ -139,9 +139,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']))
@@ -191,7 +189,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 f8a1ac7..22c0c2d 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'
--
1.8.3.1
next prev parent reply other threads:[~2017-03-31 2:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-31 2:30 [PATCH 0/4] yocto-compat-layer.py updates Mark Hatle
2017-03-31 2:30 ` [PATCH 1/4] yocto-compat-layer.py: Add status for skipped items Mark Hatle
2017-03-31 2:30 ` [PATCH 2/4] yocto-compat-layer.py: Add --dependency argument Mark Hatle
2017-03-31 2:30 ` [PATCH 3/4] compatlayer/__init__.py: Allow add_layer to process recursive deps Mark Hatle
2017-03-31 2:30 ` Mark Hatle [this message]
2017-04-03 19:03 ` [PATCH 0/4] yocto-compat-layer.py updates Aníbal Limón
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1490927429-48266-5-git-send-email-mark.hatle@windriver.com \
--to=mark.hatle@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=saul.wold@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox