From 7b119ca128afbdb599259484bf1cccb09b19ee76 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 3 Nov 2023 13:28:09 +0000 Subject: cve-check: sort the package list in the JSON report The JSON report generated by the cve-check class is basically a huge list of packages. This list of packages is, however, unsorted. To make things easier for people comparing the JSON, or more specifically for git when archiving the JSON over time in a git repository, we can sort the list by package name. (From OE-Core rev: f3d9dd947e678078b57b4b607e231b702c26dd4a) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/cve-check.bbclass | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta') diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index b55f4299da..5191d04303 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass @@ -138,6 +138,8 @@ def generate_json_report(d, out_path, link_path): cve_check_merge_jsons(summary, data) filename = f.readline() + summary["package"].sort(key=lambda d: d['name']) + with open(out_path, "w") as f: json.dump(summary, f, indent=2) -- cgit v1.2.3-54-g00ecf