diff options
author | Nicolas Dechesne <nicolas.dechesne@linaro.org> | 2021-07-22 14:46:44 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-28 23:47:00 +0100 |
commit | 356137bcf23eabaacbefddf265edb638e0f3fe1d (patch) | |
tree | 087e918b11cf86c671c391395dadc52a780148af /scripts/yocto-check-layer | |
parent | 8dbef94dce59c70c5904e418647eae6a4365163c (diff) | |
download | poky-356137bcf23eabaacbefddf265edb638e0f3fe1d.tar.gz |
yocto-check-layer: ensure that all layer dependencies are tested too
In order to be compliant with the YP compatible status, a layer also
needs to ensure that all its dependencies are compatible
too. Currently yocto-check-layer only checks the requested layer,
without testing any dependencies.
With this change, all dependencies are also checked by default, so the
summary printed at the end will give a clear picture whether all
dependencies pass the script or not.
Using --no-auto-dependency can be used to skip that.
(From OE-Core rev: 45d59b774b95c91193a8376b83c05291d555e5c8)
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/yocto-check-layer')
-rwxr-xr-x | scripts/yocto-check-layer | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 9aeb311c95..2445ad5e43 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer | |||
@@ -24,7 +24,7 @@ import scriptpath | |||
24 | scriptpath.add_oe_lib_path() | 24 | scriptpath.add_oe_lib_path() |
25 | scriptpath.add_bitbake_lib_path() | 25 | scriptpath.add_bitbake_lib_path() |
26 | 26 | ||
27 | from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers | 27 | from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers |
28 | from oeqa.utils.commands import get_bb_vars | 28 | from oeqa.utils.commands import get_bb_vars |
29 | 29 | ||
30 | PROGNAME = 'yocto-check-layer' | 30 | PROGNAME = 'yocto-check-layer' |
@@ -51,6 +51,8 @@ def main(): | |||
51 | help='File to output log (optional)', action='store') | 51 | help='File to output log (optional)', action='store') |
52 | parser.add_argument('--dependency', nargs="+", | 52 | parser.add_argument('--dependency', nargs="+", |
53 | help='Layers to process for dependencies', action='store') | 53 | help='Layers to process for dependencies', action='store') |
54 | parser.add_argument('--no-auto-dependency', help='Disable automatic testing of dependencies', | ||
55 | action='store_true') | ||
54 | parser.add_argument('--machines', nargs="+", | 56 | parser.add_argument('--machines', nargs="+", |
55 | help='List of MACHINEs to be used during testing', action='store') | 57 | help='List of MACHINEs to be used during testing', action='store') |
56 | parser.add_argument('--additional-layers', nargs="+", | 58 | parser.add_argument('--additional-layers', nargs="+", |
@@ -121,6 +123,21 @@ def main(): | |||
121 | if not layers: | 123 | if not layers: |
122 | return 1 | 124 | return 1 |
123 | 125 | ||
126 | # Find all dependencies, and get them checked too | ||
127 | if not args.no_auto_dependency: | ||
128 | depends = [] | ||
129 | for layer in layers: | ||
130 | layer_depends = get_layer_dependencies(layer, dep_layers, logger) | ||
131 | if layer_depends: | ||
132 | for d in layer_depends: | ||
133 | if d not in depends: | ||
134 | depends.append(d) | ||
135 | |||
136 | for d in depends: | ||
137 | if d not in layers: | ||
138 | logger.info("Adding %s to the list of layers to test, as a dependency", d['name']) | ||
139 | layers.append(d) | ||
140 | |||
124 | shutil.copyfile(bblayersconf, bblayersconf + '.backup') | 141 | shutil.copyfile(bblayersconf, bblayersconf + '.backup') |
125 | def cleanup_bblayers(signum, frame): | 142 | def cleanup_bblayers(signum, frame): |
126 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) | 143 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) |