Skip to contentSkip to conversation

cve-check: add json format

PATCH Marta Rybczynska 1 participant 1 message Feb 3, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Marta Rybczynska via lists.openembedded.org

Add an option to output the CVE check in a JSON-based format. This format is easier to parse in software than the original text-based one and allows post-processing by other tools.

Quoted 10 lines

Output formats are now handed by CVE_CHECK_FORMAT_TEXT and CVE_CHECK_FORMAT_JSON. Both of them are enabled by default.

The JSON output format gets generated in a similar way to the text format with the exception of the manifest: appending to JSON arrays requires parsing the file. Because of that we first write JSON fragments and then assemble them in one pass at the end.

Any comments on this approach? It is also building a foundation for adding also per-package statistics and easier post-processing. For example, I do have a script processing the JSON to get a CSV spreadsheet.

Kind regards,
Marta