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-07-28 23:46:56 +0100
commit45d59b774b95c91193a8376b83c05291d555e5c8 (patch)
treea2f60694d07ccdef74a93083de9c14be91c03277 /scripts
parente9b7690ab30d0e7c07471034f6cb89ccc3168a11 (diff)
downloadopenembedded-core-45d59b774b95c91193a8376b83c05291d555e5c8.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. 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')
-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 9aeb311c95..2445ad5e43 100755
--- a/scripts/yocto-check-layer
+++ b/scripts/yocto-check-layer
@@ -24,7 +24,7 @@ import scriptpath
scriptpath.add_oe_lib_path()
scriptpath.add_bitbake_lib_path()
-from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers
+from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_layer_dependencies, get_signatures, check_bblayers
from oeqa.utils.commands import get_bb_vars
PROGNAME = 'yocto-check-layer'
@@ -51,6 +51,8 @@ def main():
help='File to output log (optional)', action='store')
parser.add_argument('--dependency', nargs="+",
help='Layers to process for dependencies', action='store')
+ parser.add_argument('--no-auto-dependency', help='Disable automatic testing of dependencies',
+ action='store_true')
parser.add_argument('--machines', nargs="+",
help='List of MACHINEs to be used during testing', action='store')
parser.add_argument('--additional-layers', nargs="+",
@@ -121,6 +123,21 @@ def main():
if not layers:
return 1
+ # Find all dependencies, and get them checked too
+ if not args.no_auto_dependency:
+ depends = []
+ for layer in layers:
+ layer_depends = get_layer_dependencies(layer, dep_layers, logger)
+ if layer_depends:
+ for d in layer_depends:
+ if d not in depends:
+ depends.append(d)
+
+ for d in depends:
+ if d not in layers:
+ logger.info("Adding %s to the list of layers to test, as a dependency", d['name'])
+ layers.append(d)
+
shutil.copyfile(bblayersconf, bblayersconf + '.backup')
def cleanup_bblayers(signum, frame):
shutil.copyfile(bblayersconf + '.backup', bblayersconf)