diff options
author | Ross Burton <ross.burton@arm.com> | 2023-10-23 18:38:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-26 15:29:34 +0100 |
commit | a9986a21842e22b0835071913edfd129bdc3346e (patch) | |
tree | d859b1f3cdb70f6913cfcae379502ad355af32a3 /meta/classes/cve-check.bbclass | |
parent | 58b86dbf5e991079491005c545f04ec4fba2038f (diff) | |
download | poky-a9986a21842e22b0835071913edfd129bdc3346e.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: e9861be0e5020830c2ecc24fd091f4f5b05da036)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/cve-check.bbclass')
-rw-r--r-- | meta/classes/cve-check.bbclass | 2 |
1 files changed, 2 insertions, 0 deletions
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): | |||
138 | cve_check_merge_jsons(summary, data) | 138 | cve_check_merge_jsons(summary, data) |
139 | filename = f.readline() | 139 | filename = f.readline() |
140 | 140 | ||
141 | summary["package"].sort(key=lambda d: d['name']) | ||
142 | |||
141 | with open(out_path, "w") as f: | 143 | with open(out_path, "w") as f: |
142 | json.dump(summary, f, indent=2) | 144 | json.dump(summary, f, indent=2) |
143 | 145 | ||