diff mbox series

[poky,master,kirkstone,1/2] cve-check.bbclass: Add anonymous function to get patched CVEs from recipe

Message ID 20220712144246.8942-1-akash.hadke@kpit.com
State New, archived
Headers show
Series [poky,master,kirkstone,1/2] cve-check.bbclass: Add anonymous function to get patched CVEs from recipe | expand

Commit Message

Akash Hadke July 12, 2022, 2:42 p.m. UTC
Add an anonymous function to get patched CVEs from the recipe
and set the value to 'CVE_PATCHED' variable
This variable later can be used to do CVE data processing
outside of bitbake

Signed-off-by: Akash Hadke <akash.hadke@kpit.com>
---
 meta/classes/cve-check.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes/cve-check.bbclass b/meta/classes/cve-check.bbclass
index da7f93371c..2f1a3ec706 100644
--- a/meta/classes/cve-check.bbclass
+++ b/meta/classes/cve-check.bbclass
@@ -82,6 +82,14 @@  CVE_CHECK_LAYER_INCLUDELIST ??= ""
 # set to "alphabetical" for version using single alphabetical character as increment release
 CVE_VERSION_SUFFIX ??= ""
 
+# Patched CVEs from recipe will be assigned to this variable
+CVE_PATCHED ??= ""
+
+python() {
+    from oe.cve_check import get_patched_cves
+    d.setVar('CVE_PATCHED', " ".join(get_patched_cves(d)))
+}
+
 def generate_json_report(d, out_path, link_path):
     if os.path.exists(d.getVar("CVE_CHECK_SUMMARY_INDEX_PATH")):
         import json