]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cve-check: sort the package list in the JSON report
authorRoss Burton <ross.burton@arm.com>
Mon, 23 Oct 2023 17:38:21 +0000 (18:38 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 26 Oct 2023 14:28:23 +0000 (15:28 +0100)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/cve-check.bbclass

index b55f4299da3a6c3eaa5e42ab2db61f7cc9352d27..5191d043030e35bddd3f50abc99a66d3541b8656 100644 (file)
@@ -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)