diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2022-08-03 16:55:16 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2022-08-03 17:56:03 +0300 |
commit | bec4ebc22c43c1ff5c3fddb820d44a88bd3aebf0 (patch) | |
tree | cd378e3e0eaff8fe11880bd397f41671e2347a39 /meta-arm/scripts/layer-overview.py | |
parent | 79161d7a7126cad324ff0c11a93d8e57d80203ed (diff) | |
download | openbmc-bec4ebc22c43c1ff5c3fddb820d44a88bd3aebf0.tar.xz |
Import 80d60e7 from yoctoproject.org meta-arm
To support ARMv8 SoCs.
meta-arm has several patch files. Since they are maintained by the
upstream meta-arm community, add meta-arm to the ignore list in
run-repotest.
Change-Id: Ia87a2e947bbabd347d256eccc47a343e1c885479
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-arm/scripts/layer-overview.py')
-rwxr-xr-x | meta-arm/scripts/layer-overview.py | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/meta-arm/scripts/layer-overview.py b/meta-arm/scripts/layer-overview.py new file mode 100755 index 0000000000..326470e64b --- /dev/null +++ b/meta-arm/scripts/layer-overview.py @@ -0,0 +1,74 @@ +#! /usr/bin/env python3 + +""" +Print an overview of the layer to help writing release notes. + +Output includes sublayers, machines, recipes. +""" + +import argparse +import sys + +# TODO: +# - More human-readable output +# - Diff mode, give two revisions and list the changes + +def is_layer(path): + """ + Determine if this path looks like a layer (is a directory and contains conf/layer.conf). + """ + return path.is_dir() and (path / "conf" / "layer.conf").exists() + + +def print_layer(layer): + """ + Print a summary of the layer. + """ + print(layer.name) + + machines = sorted(p for p in layer.glob("conf/machine/*.conf")) + if machines: + print(" Machines") + for m in machines: + print(f" {m.stem}") + print() + + recipes = sorted((p for p in layer.glob("recipes-*/*/*.bb")), key=lambda p:p.name) + if recipes: + print(" Recipes") + for r in recipes: + if "_" in r.stem: + pn, pv = r.stem.rsplit("_", 1) + print(f" {pn} {pv}") + else: + print(f" {r.stem}") + print() + + +parser = argparse.ArgumentParser() +parser.add_argument("repository") +parser.add_argument("revision", nargs="?") +args = parser.parse_args() + +if args.revision: + import gitpathlib + base = gitpathlib.GitPath(args.repository, args.revision) +else: + import pathlib + base = pathlib.Path(args.repository) + +if is_layer(base): + print_layer(base) +else: + sublayers = sorted(p for p in base.glob("meta-*") if is_layer(p)) + if sublayers: + print("Sub-Layers") + for l in sublayers: + print(f" {l.name}") + print() + + for layer in sublayers: + print_layer(layer) + else: + print(f"No layers found in {base}", file=sys.stderr) + sys.exit(1) |