Skip to content

Commit 2942d46

Browse files
OsterlaDrpurdie
authored andcommitted
spdx: add support for WITH operator
Adds the + operator for use in LICENSE field. It is replaced by SPDX WITH operator. Signed-off-by: Denis Osterland-Heim <[email protected]> Signed-off-by: Mathieu Dubois-Briand <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent 8b5324e commit 2942d46

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

meta/lib/oe/license.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def __init__(self, license):
4747
def __str__(self):
4848
return "invalid characters in license '%s'" % self.license
4949

50-
license_operator_chars = '&|() '
50+
license_operator_chars = '&|()+ '
5151
license_operator = re.compile(r'([' + license_operator_chars + '])')
52-
license_pattern = re.compile(r'[a-zA-Z0-9.+_\-]+$')
52+
license_pattern = re.compile(r'[a-zA-Z0-9._\-]+$')
5353

5454
class LicenseVisitor(ast.NodeVisitor):
5555
"""Get elements based on OpenEmbedded license strings"""

meta/lib/oe/spdx30_tasks.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ def convert(l):
9797
if l == "|":
9898
return "OR"
9999

100+
if l == "+":
101+
return "WITH"
102+
100103
if l == "CLOSED":
101104
return "NONE"
102105

@@ -115,6 +118,7 @@ def convert(l):
115118
.replace(")", " ) ")
116119
.replace("|", " | ")
117120
.replace("&", " & ")
121+
.replace("+", " + ")
118122
.split()
119123
)
120124
spdx_license_expression = " ".join(convert(l) for l in lic_split)

0 commit comments

Comments
 (0)