Skip to contentSkip to conversation

create-spdx: Fix supplier field

PATCH In review Mihai Lindner 2 participants 2 messages Jul 27, 2022 – Jul 28, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 create-spdx: Fix supplier field

The correct field name is "supplier" according to SPDX schema. The "supplier" field translates to "PackageSupplier", but that's for tag-value format.

---
 meta/classes/create-spdx.bbclass | 6 +++---
 meta/lib/oe/spdx.py              | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
meta/classes/create-spdx.bbclass +3 -3
index 15cccac84b..21cd5be3cb 100644
@@ -451,7 +451,7 @@ python do_create_spdx() {
     recipe.name = d.getVar("PN")
     recipe.versionInfo = d.getVar("PV")
     recipe.SPDXID = oe.sbom.get_recipe_spdxid(d)
-    recipe.packageSupplier = d.getVar("SPDX_SUPPLIER")
+    recipe.supplier = d.getVar("SPDX_SUPPLIER")
     if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
         recipe.annotations.append(create_annotation(d, "isNative"))
 
@@ -561,7 +561,7 @@ python do_create_spdx() {
             spdx_package.name = pkg_name
             spdx_package.versionInfo = d.getVar("PV")
             spdx_package.licenseDeclared = convert_license_to_spdx(package_license, package_doc, d, found_licenses)
-            spdx_package.packageSupplier = d.getVar("SPDX_SUPPLIER")
+            spdx_package.supplier = d.getVar("SPDX_SUPPLIER")
 
             package_doc.packages.append(spdx_package)
 
@@ -901,7 +901,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages):
     image.name = d.getVar("PN")
     image.versionInfo = d.getVar("PV")
     image.SPDXID = rootfs_spdxid
-    image.packageSupplier = d.getVar("SPDX_SUPPLIER")
+    image.supplier = d.getVar("SPDX_SUPPLIER")
 
     doc.packages.append(image)
 
meta/lib/oe/spdx.py +1 -1
index 14ca706895..6d56ed90df 100644
@@ -218,7 +218,7 @@ class SPDXPackage(SPDXObject):
     SPDXID = _String()
     versionInfo = _String()
     downloadLocation = _String(default="NOASSERTION")
-    packageSupplier = _String(default="NOASSERTION")
+    supplier = _String(default="NOASSERTION")
     homepage = _String()
     licenseConcluded = _String(default="NOASSERTION")
     licenseDeclared = _String(default="NOASSERTION")
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Mihai Lindner

The correct field name is "supplier" according to SPDX schema. The "supplier" field translates to "PackageSupplier", but that's for tag-value format.

LGTM, Thanks.

Quoted 51 lines
---
  meta/classes/create-spdx.bbclass | 6 +++---
  meta/lib/oe/spdx.py              | 2 +-
  2 files changed, 4 insertions(+), 4 deletions(-)
meta/classes/create-spdx.bbclass +3 -3
index 15cccac84b..21cd5be3cb 100644
@@ -451,7 +451,7 @@ python do_create_spdx() {
      recipe.name = d.getVar("PN")
      recipe.versionInfo = d.getVar("PV")
      recipe.SPDXID = oe.sbom.get_recipe_spdxid(d)
-    recipe.packageSupplier = d.getVar("SPDX_SUPPLIER")
+    recipe.supplier = d.getVar("SPDX_SUPPLIER")
      if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
          recipe.annotations.append(create_annotation(d, "isNative"))
 
@@ -561,7 +561,7 @@ python do_create_spdx() {
              spdx_package.name = pkg_name
              spdx_package.versionInfo = d.getVar("PV")
              spdx_package.licenseDeclared = convert_license_to_spdx(package_license, package_doc, d, found_licenses)
-            spdx_package.packageSupplier = d.getVar("SPDX_SUPPLIER")
+            spdx_package.supplier = d.getVar("SPDX_SUPPLIER")
 
              package_doc.packages.append(spdx_package)
 
@@ -901,7 +901,7 @@ def combine_spdx(d, rootfs_name, rootfs_deploydir, rootfs_spdxid, packages):
      image.name = d.getVar("PN")
      image.versionInfo = d.getVar("PV")
      image.SPDXID = rootfs_spdxid
-    image.packageSupplier = d.getVar("SPDX_SUPPLIER")
+    image.supplier = d.getVar("SPDX_SUPPLIER")
 
      doc.packages.append(image)
 
meta/lib/oe/spdx.py +1 -1
index 14ca706895..6d56ed90df 100644
@@ -218,7 +218,7 @@ class SPDXPackage(SPDXObject):
      SPDXID = _String()
      versionInfo = _String()
      downloadLocation = _String(default="NOASSERTION")
-    packageSupplier = _String(default="NOASSERTION")
+    supplier = _String(default="NOASSERTION")
      homepage = _String()
      licenseConcluded = _String(default="NOASSERTION")
      licenseDeclared = _String(default="NOASSERTION")