diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2021-09-01 08:44:50 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-09-03 09:03:36 +0100 |
commit | 28d9d035c0ff8fcaf28bc96a976a43a602a47e94 (patch) | |
tree | 8ded78ce591e7d2d4ef53009498f50993f83a80f /meta/lib/oe/spdx.py | |
parent | df7c88a48621d32c02f328eedc314f10d475b758 (diff) | |
download | openembedded-core-contrib-28d9d035c0ff8fcaf28bc96a976a43a602a47e94.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
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/spdx.py')
-rw-r--r-- | meta/lib/oe/spdx.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/spdx.py b/meta/lib/oe/spdx.py index 3f569c6862..9814fbfd66 100644 --- a/meta/lib/oe/spdx.py +++ b/meta/lib/oe/spdx.py @@ -189,6 +189,13 @@ class SPDXExternalDocumentRef(SPDXObject): checksum = _Object(SPDXChecksum) +class SPDXExtractedLicensingInfo(SPDXObject): + name = _String() + comment = _String() + licenseId = _String() + extractedText = _String() + + class SPDXDocument(SPDXObject): spdxVersion = _String(default="SPDX-" + SPDX_VERSION) dataLicense = _String(default="CC0-1.0") @@ -200,6 +207,7 @@ class SPDXDocument(SPDXObject): files = _ObjectList(SPDXFile) relationships = _ObjectList(SPDXRelationship) externalDocumentRefs = _ObjectList(SPDXExternalDocumentRef) + hasExtractedLicensingInfos = _ObjectList(SPDXExtractedLicensingInfo) def __init__(self, **d): super().__init__(**d) |