diff options
| -rw-r--r-- | meta/lib/oe/spdx.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oe/spdx.py b/meta/lib/oe/spdx.py index 4416194e06..9e7ced5a15 100644 --- a/meta/lib/oe/spdx.py +++ b/meta/lib/oe/spdx.py | |||
| @@ -196,6 +196,7 @@ class SPDXRelationship(SPDXObject): | |||
| 196 | relatedSpdxElement = _String() | 196 | relatedSpdxElement = _String() |
| 197 | relationshipType = _String() | 197 | relationshipType = _String() |
| 198 | comment = _String() | 198 | comment = _String() |
| 199 | annotations = _ObjectList(SPDXAnnotation) | ||
| 199 | 200 | ||
| 200 | 201 | ||
| 201 | class SPDXExternalReference(SPDXObject): | 202 | class SPDXExternalReference(SPDXObject): |
| @@ -300,7 +301,7 @@ class SPDXDocument(SPDXObject): | |||
| 300 | def from_json(cls, f): | 301 | def from_json(cls, f): |
| 301 | return cls(**json.load(f)) | 302 | return cls(**json.load(f)) |
| 302 | 303 | ||
| 303 | def add_relationship(self, _from, relationship, _to, *, comment=None): | 304 | def add_relationship(self, _from, relationship, _to, *, comment=None, annotation=None): |
| 304 | if isinstance(_from, SPDXObject): | 305 | if isinstance(_from, SPDXObject): |
| 305 | from_spdxid = _from.SPDXID | 306 | from_spdxid = _from.SPDXID |
| 306 | else: | 307 | else: |
| @@ -320,6 +321,9 @@ class SPDXDocument(SPDXObject): | |||
| 320 | if comment is not None: | 321 | if comment is not None: |
| 321 | r.comment = comment | 322 | r.comment = comment |
| 322 | 323 | ||
| 324 | if annotation is not None: | ||
| 325 | r.annotations.append(annotation) | ||
| 326 | |||
| 323 | self.relationships.append(r) | 327 | self.relationships.append(r) |
| 324 | 328 | ||
| 325 | def find_by_spdxid(self, spdxid): | 329 | def find_by_spdxid(self, spdxid): |
