Skip to content

Commit 5732c4f

Browse files
committed
create-spdx: Init sourceInfo to empty string
Signed-off-by: Can Wong <can.wong@emerson.com>
1 parent 84e1fe6 commit 5732c4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

meta/classes/create-spdx-2.2.bbclass

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ python do_create_spdx() {
599599
# Some CVEs may be patched during the build process without incrementing the version number,
600600
# so querying for CVEs based on the CPE id can lead to false positives. To account for this,
601601
# save the CVEs fixed by patches to source information field in the SPDX.
602+
recipe.sourceInfo = ""
602603
patched_cves = oe.cve_check.get_patched_cves(d)
603604
patched_cves = list(patched_cves)
604605
patched_cves = ' '.join(patched_cves)
@@ -611,10 +612,9 @@ python do_create_spdx() {
611612
if ignored_cves:
612613
if patched_cves:
613614
recipe.sourceInfo += "; "
614-
else:
615-
recipe.sourceInfo = ""
616615
recipe.sourceInfo += "CVEs ignored: " + ignored_cves
617616

617+
618618
cpe_ids = oe.cve_check.get_cpe_ids(d.getVar("CVE_PRODUCT"), d.getVar("CVE_VERSION"))
619619
if cpe_ids:
620620
for cpe_id in cpe_ids:

0 commit comments

Comments
 (0)