mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
buildstats-summary: look for buildstats if not specified
If the user hasn't specified a buildstats directory, use the latest entry under $BUILDDIR. (From OE-Core rev: aeb69fbe130dca37b39d4065ec983441e0052803) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
9d287835b2
commit
9dd8d5d6d2
|
@ -87,7 +87,11 @@ def main(argv=None) -> int:
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"buildstats", metavar="BUILDSTATS", help="Buildstats file", type=pathlib.Path
|
"buildstats",
|
||||||
|
metavar="BUILDSTATS",
|
||||||
|
nargs="?",
|
||||||
|
type=pathlib.Path,
|
||||||
|
help="Buildstats file, or latest if not specified",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--sort",
|
"--sort",
|
||||||
|
@ -116,6 +120,16 @@ def main(argv=None) -> int:
|
||||||
|
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
|
# If a buildstats file wasn't specified, try to find the last one
|
||||||
|
if not args.buildstats:
|
||||||
|
try:
|
||||||
|
builddir = pathlib.Path(os.environ["BUILDDIR"])
|
||||||
|
buildstats_dir = builddir / "tmp" / "buildstats"
|
||||||
|
args.buildstats = sorted(buildstats_dir.iterdir())[-1]
|
||||||
|
except KeyError:
|
||||||
|
print("Build environment has not been configured, cannot find buildstats")
|
||||||
|
return 1
|
||||||
|
|
||||||
bs = read_buildstats(args.buildstats)
|
bs = read_buildstats(args.buildstats)
|
||||||
dump_buildstats(args, bs)
|
dump_buildstats(args, bs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user