summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cve-check.bbclass18
1 files changed, 10 insertions, 8 deletions
diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index ac9f0fb22c..34c38bdf2d 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -75,7 +75,7 @@ CVE_CHECK_LAYER_INCLUDELIST ??= ""
75# set to "alphabetical" for version using single alphabetical character as increment release 75# set to "alphabetical" for version using single alphabetical character as increment release
76CVE_VERSION_SUFFIX ??= "" 76CVE_VERSION_SUFFIX ??= ""
77 77
78def generate_json_report(out_path, link_path): 78def generate_json_report(d, out_path, link_path):
79 if os.path.exists(d.getVar("CVE_CHECK_SUMMARY_INDEX_PATH")): 79 if os.path.exists(d.getVar("CVE_CHECK_SUMMARY_INDEX_PATH")):
80 import json 80 import json
81 from oe.cve_check import cve_check_merge_jsons 81 from oe.cve_check import cve_check_merge_jsons
@@ -123,10 +123,11 @@ python cve_save_summary_handler () {
123 os.remove(cvefile_link) 123 os.remove(cvefile_link)
124 os.symlink(os.path.basename(cve_summary_file), cvefile_link) 124 os.symlink(os.path.basename(cve_summary_file), cvefile_link)
125 125
126 if d.getVar("CVE_CHECK_FORMAT_JSON") == "1":
126 json_summary_link_name = os.path.join(cvelogpath, d.getVar("CVE_CHECK_SUMMARY_FILE_NAME_JSON")) 127 json_summary_link_name = os.path.join(cvelogpath, d.getVar("CVE_CHECK_SUMMARY_FILE_NAME_JSON"))
127 json_summary_name = os.path.join(cvelogpath, "%s-%s.json" % (cve_summary_name, timestamp)) 128 json_summary_name = os.path.join(cvelogpath, "%s-%s.json" % (cve_summary_name, timestamp))
128 generate_json_report(json_summary_name, json_summary_link_name) 129 generate_json_report(d, json_summary_name, json_summary_link_name)
129 bb.plain("CVE report summary created at: %s" % json_summary_link_name) 130 bb.plain("Complete CVE JSON report summary created at: %s" % json_summary_link_name)
130} 131}
131 132
132addhandler cve_save_summary_handler 133addhandler cve_save_summary_handler
@@ -202,11 +203,12 @@ python cve_check_write_rootfs_manifest () {
202 os.symlink(os.path.basename(manifest_name), manifest_link) 203 os.symlink(os.path.basename(manifest_name), manifest_link)
203 bb.plain("Image CVE report stored in: %s" % manifest_name) 204 bb.plain("Image CVE report stored in: %s" % manifest_name)
204 205
205 link_path = os.path.join(deploy_dir, "%s.json" % link_name) 206 if d.getVar("CVE_CHECK_FORMAT_JSON") == "1":
206 manifest_path = d.getVar("CVE_CHECK_MANIFEST_JSON") 207 link_path = os.path.join(deploy_dir, "%s.json" % link_name)
207 bb.note("Generating JSON CVE manifest") 208 manifest_path = d.getVar("CVE_CHECK_MANIFEST_JSON")
208 generate_json_report(json_summary_name, json_summary_link_name) 209 bb.note("Generating JSON CVE manifest")
209 bb.plain("Image CVE JSON report stored in: %s" % link_path) 210 generate_json_report(d, manifest_path, link_path)
211 bb.plain("Image CVE JSON report stored in: %s" % link_path)
210} 212}
211 213
212ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}" 214ROOTFS_POSTPROCESS_COMMAND_prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}"