From: Ross Burton Date: Mon, 23 Oct 2023 17:38:21 +0000 (+0100) Subject: cve-check: sort the package list in the JSON report X-Git-Tag: 2020-04.30~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a509bc6f26247cc7561189d582c91816042fd91;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git 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. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie (cherry picked from commit e9861be0e5020830c2ecc24fd091f4f5b05da036) Signed-off-by: Steve Sakoman --- diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass index b0ccefc84d1..5e6bae17570 100644 --- a/meta/classes/cve-check.bbclass +++ b/meta/classes/cve-check.bbclass @@ -97,6 +97,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)