summaryrefslogtreecommitdiffstats
path: root/meta/classes
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-14 06:49:11 -1000
commitae28221a40f2d88986dde58d3b006098510d366f (patch)
tree5544fcd865d350106a18a50fac93e0178a80ad3d /meta/classes
parent4e227eaf1c063edda2132112c804f33c964f710d (diff)
downloadpoky-ae28221a40f2d88986dde58d3b006098510d366f.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: 1245649fd2725915154648a98584c908da07af18) 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>
Diffstat (limited to 'meta/classes')
-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 494fa03ec1..f554150d94 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -98,6 +98,8 @@ def generate_json_report(d, out_path, link_path):
98 cve_check_merge_jsons(summary, data) 98 cve_check_merge_jsons(summary, data)
99 filename = f.readline() 99 filename = f.readline()
100 100
101 summary["package"].sort(key=lambda d: d['name'])
102
101 with open(out_path, "w") as f: 103 with open(out_path, "w") as f:
102 json.dump(summary, f, indent=2) 104 json.dump(summary, f, indent=2)
103 105