Skip to content

Commit

Permalink
allow and, or and with operators
Browse files Browse the repository at this point in the history
This is follow up of discussion https://lists.spdx.org/g/spdx/message/1798
where this was found as good compromise https://lists.spdx.org/g/spdx/message/1817

Signed-off-by: Miroslav Suchý <[email protected]>
  • Loading branch information
xsuchy committed Mar 7, 2024
1 parent 6171b39 commit d7b698a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/annexes/SPDX-license-expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ addition-expression = license-exception-id / addition-ref
compound-expression = (simple-expression /
simple-expression "WITH" addition-expression /
simple-expression ( "WITH" / "with" ) addition-expression /
compound-expression "AND" compound-expression /
compound-expression ( "AND" / "and" ) compound-expression /
compound-expression "OR" compound-expression /
compound-expression ( "OR" / "or" ) compound-expression /
"(" compound-expression ")" )
Expand All @@ -50,7 +50,7 @@ In the `tag:value` format, a license expression MUST be on a single line, and MU

## D.2 Case sensitivity <a name="D.2"></a>

License expression operators (`AND`, `OR` and `WITH`) should be matched in a *case-sensitive* manner.
License expression operators (`AND`, `and`, `OR`, `or`, `WITH` and `with`) should be matched in a *case-sensitive* manner, i.e., letters must be all upper case or all lower case.

License identifiers (including license exception identifiers) used in SPDX documents or source code files should be matched in a *case-insensitive* manner. In other words, `MIT`, `Mit` and `mIt` should all be treated as the same identifier and referring to the same license.

Expand Down Expand Up @@ -109,6 +109,8 @@ An example representing a choice between three different licenses would be:
LGPL-2.1-only OR MIT OR BSD-3-Clause
```

It is allowed to use the operator in lower case form `or`.

### D.4.3 Conjunctive "AND" operator <a name="D.4.3"></a>

If required to simultaneously comply with two or more licenses, use the conjunctive binary "AND" operator to construct a new license expression, where both the left and right operands are a valid license expression values.
Expand All @@ -131,6 +133,8 @@ An example where all three different licenses apply would be:
LGPL-2.1-only AND MIT AND BSD-2-Clause
```

It is allowed to use the operator in lower case form `and`.

### D.4.4 Additive "WITH" operator <a name="D.4.4"></a>

Sometimes license texts are found with additional text, which might or might not modify the original license terms.
Expand All @@ -148,6 +152,8 @@ GPL-2.0-or-later WITH Bison-exception-2.2

The current set of valid license exceptions identifiers can be found in [spdx.org/licenses](https://spdx.org/licenses).

It is allowed to use the operator in lower case form `with`.

### D.4.5 Order of precedence and parentheses <a name="D.4.5"></a>

The order of application of the operators in an expression matters (similar to mathematical operators). The default operator order of precedence of a `<license-expression>` a is:
Expand Down

0 comments on commit d7b698a

Please sign in to comment.