yocto-check-layer: add option to skip sublayer
PATCH 1/1 yocto-check-layer: add option to skip sublayer
From: Mingli Yu <[email protected]>
When do yocto compliance for a layer which contains many sublayers, we may just want to check the top-level layer, so add one option to achieve this.
Before the patch:
$ yocto-check-layer-wrapper ../layers/meta-cloud-services --dependency ../layers/meta-openembedded ../layers/meta-virtualization --no-auto-dependency [snip] INFO: meta-cloud-services ... PASS INFO: meta-openstack-controller-deploy ... PASS INFO: meta-openstack-aio-deploy ... PASS INFO: meta-openstack-compute-test-config ... PASS INFO: meta-openstack-controller-test-config ... PASS INFO: meta-openstack-compute-deploy ... PASS INFO: meta-openstack-swift-deploy ... PASS INFO: meta-openstack ... PASS INFO: meta-openstack-qemu ... PASS
After the patch:
$ yocto-check-layer-wrapper ../layers/meta-cloud-services --dependency ../layers/meta-openembedded ../layers/meta-virtualization --no-auto-dependency --no-sub [snip] INFO: meta-cloud-services ... PASS
Signed-off-by Mingli Yu <[email protected]>
--- scripts/lib/checklayer/__init__.py | 9 ++++++++- scripts/yocto-check-layer | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-)
scripts/lib/checklayer/__init__.py +8 -1
@@ -121,7 +121,7 @@ def _detect_layer(layer_path): return layer -def detect_layers(layer_directories, no_auto): +def detect_layers(layer_directories, no_auto, no_sub=0): layers = [] for directory in layer_directories:
@@ -129,6 +129,13 @@ def detect_layers(layer_directories, no_auto): if directory[-1] == '/': directory = directory[0:-1] + if no_sub: + conf_dir = os.path.join(directory, 'conf') + if os.path.isdir(conf_dir): + layer = _detect_layer(directory) + if layer: + layers.append(layer) + continue if no_auto: conf_dir = os.path.join(directory, 'conf') if os.path.isdir(conf_dir):
scripts/yocto-check-layer +3 -1
@@ -71,6 +71,8 @@ def main(): help='disable signature checking for software layers') parser.add_argument('-n', '--no-auto', help='Disable auto layer discovery', action='store_true') + parser.add_argument('-s', '--no-sub', help='Disable auto sublayer testing', + action='store_true') parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors',
@@ -98,7 +100,7 @@ def main(): builddir = os.environ['BUILDDIR'] bblayersconf = os.path.join(builddir, 'conf', 'bblayers.conf') - layers = detect_layers(args.layers, args.no_auto) + layers = detect_layers(args.layers, args.no_auto, args.no_sub) if not layers: logger.error("Failed to detect layers") return 1
Signature · 1 line
2.25.1
Quoted 24 lines · Mingli
From: Mingli Yu <[email protected]>
When do yocto compliance for a layer which contains many sublayers, we may just want to check the top-level layer, so add one option to achieve this.
Before the patch:
$ yocto-check-layer-wrapper ../layers/meta-cloud-services --dependency ../layers/meta-openembedded ../layers/meta-virtualization --no-auto-dependency [snip] INFO: meta-cloud-services ... PASS INFO: meta-openstack-controller-deploy ... PASS INFO: meta-openstack-aio-deploy ... PASS INFO: meta-openstack-compute-test-config ... PASS INFO: meta-openstack-controller-test-config ... PASS INFO: meta-openstack-compute-deploy ... PASS INFO: meta-openstack-swift-deploy ... PASS INFO: meta-openstack ... PASS INFO: meta-openstack-qemu ... PASSAfter the patch:
$ yocto-check-layer-wrapper ../layers/meta-cloud-services --dependency ../layers/meta-openembedded ../layers/meta-virtualization --no-auto-dependency --no-sub [snip] INFO: meta-cloud-services ... PASS
Quoted 5 lines
Signed-off-by Mingli Yu <[email protected]>--- scripts/lib/checklayer/__init__.py | 9 ++++++++- scripts/yocto-check-layer | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-)
I'm not sure this is a good idea as it may lead to people claiming a layer is compatible when a sublayer within that isn't?
Cheers,
Richard