summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2021-09-01 13:44:50 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-03 08:53:28 (GMT)
commit902480107dd0db7b77ada4654d2e0f061a04765d (patch)
tree8078d3cb307999d69d1eba7360d1455b06d303fa /meta/lib
parent0d5c2d9f352bb6e81d6e4f2592a074195c26f578 (diff)
downloadpoky-902480107dd0db7b77ada4654d2e0f061a04765d.tar.gz
classes/create-spdx: Fix up license reporting
Licenses reported in the SPDX documents should be either: A) A valid SPDX identifier cross referenced from the SPDX license database B) A "LicenseRef" to a license described in the SPDX document The licensing code will now add a placeholder extracted license with corresponding "LicenseRef" for any licenses that are not matched to the SPDX database Parenthesis in the license expression are now handled correctly (From OE-Core rev: 28d9d035c0ff8fcaf28bc96a976a43a602a47e94) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/spdx.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/spdx.py b/meta/lib/oe/spdx.py
index 3f569c6..9814fbf 100644
--- a/meta/lib/oe/spdx.py
+++ b/meta/lib/oe/spdx.py
@@ -189,6 +189,13 @@ class SPDXExternalDocumentRef(SPDXObject):
189 checksum = _Object(SPDXChecksum) 189 checksum = _Object(SPDXChecksum)
190 190
191 191
192class SPDXExtractedLicensingInfo(SPDXObject):
193 name = _String()
194 comment = _String()
195 licenseId = _String()
196 extractedText = _String()
197
198
192class SPDXDocument(SPDXObject): 199class SPDXDocument(SPDXObject):
193 spdxVersion = _String(default="SPDX-" + SPDX_VERSION) 200 spdxVersion = _String(default="SPDX-" + SPDX_VERSION)
194 dataLicense = _String(default="CC0-1.0") 201 dataLicense = _String(default="CC0-1.0")
@@ -200,6 +207,7 @@ class SPDXDocument(SPDXObject):
200 files = _ObjectList(SPDXFile) 207 files = _ObjectList(SPDXFile)
201 relationships = _ObjectList(SPDXRelationship) 208 relationships = _ObjectList(SPDXRelationship)
202 externalDocumentRefs = _ObjectList(SPDXExternalDocumentRef) 209 externalDocumentRefs = _ObjectList(SPDXExternalDocumentRef)
210 hasExtractedLicensingInfos = _ObjectList(SPDXExtractedLicensingInfo)
203 211
204 def __init__(self, **d): 212 def __init__(self, **d):
205 super().__init__(**d) 213 super().__init__(**d)