summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-10-23 18:38:21 +0100
committerSteve Sakoman <steve@sakoman.com>2023-11-17 06:00:32 -1000
commit38c0d384bdd7761eaba80e996d5ab41a3e049930 (patch)
tree14f64efe1eb563a4d271960962615bf849edddbe
parent01cabaea0406c4b041b45ce811408dd854bb6a79 (diff)
downloadpoky-38c0d384bdd7761eaba80e996d5ab41a3e049930.tar.gz
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: 5a509bc6f26247cc7561189d582c91816042fd91) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e9861be0e5020830c2ecc24fd091f4f5b05da036) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/classes/cve-check.bbclass2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index b0ccefc84d..5e6bae1757 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):
97 cve_check_merge_jsons(summary, data) 97 cve_check_merge_jsons(summary, data)
98 filename = f.readline() 98 filename = f.readline()
99 99
100 summary["package"].sort(key=lambda d: d['name'])
101
100 with open(out_path, "w") as f: 102 with open(out_path, "w") as f:
101 json.dump(summary, f, indent=2) 103 json.dump(summary, f, indent=2)
102 104