summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2021-07-22 14:46:44 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-10 11:14:11 +0100
commita2a412fcd7d011b2f14523d1e9804bd44db55e05 (patch)
tree12478b779f617165e7341332735ceb9ff98eafd0 /scripts
parent33b3eaa04d871d25f5221bd5746f3662f320ebd7 (diff)
downloadpoky-a2a412fcd7d011b2f14523d1e9804bd44db55e05.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: bec38becf8a489d69aca0917a2ce1dfdc96d8ab3) 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> (cherry picked from commit 45d59b774b95c91193a8376b83c05291d555e5c8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/yocto-check-layer19
1 files changed, 18 insertions, 1 deletions
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer
index 847fabfd9d..dd930cdddd 100755
--- a/scripts/yocto-check-layer
+++ b/scripts/yocto-check-layer
@@ -24,7 +24,7 @@ import scriptpath
24scriptpath.add_oe_lib_path() 24scriptpath.add_oe_lib_path()
25scriptpath.add_bitbake_lib_path() 25scriptpath.add_bitbake_lib_path()
26 26
27from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers 27from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers
28from oeqa.utils.commands import get_bb_vars 28from oeqa.utils.commands import get_bb_vars
29 29
30PROGNAME = 'yocto-check-layer' 30PROGNAME = '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)