Skip to content

Commit

Permalink
fix(spdx): Accept "additional-terms" as part of LicenseRef exceptions
Browse files Browse the repository at this point in the history
This is a hotfix for not failing SPDX reports to get generated for
ScanCode license expressions like

    AGPL-3.0-only WITH LicenseRef-scancode-agpl-generic-additional-terms

A proper future fix could be to introduce a license classification
provider interface that can query whether a given string is an exception
or not.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed May 6, 2024
1 parent 3332c90 commit f2018b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/spdx/src/main/kotlin/SpdxExpression.kt
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class SpdxLicenseWithExceptionExpression(
val exception: String
) : SpdxSingleLicenseExpression() {
companion object {
private val EXCEPTION_STRING_PATTERN = Regex("\\bexception\\b", RegexOption.IGNORE_CASE)
private val EXCEPTION_STRING_PATTERN = Regex("\\b(exception|additional-terms)\\b", RegexOption.IGNORE_CASE)

/**
* Parse a string into an [SpdxLicenseWithExceptionExpression]. Throws an [SpdxException] if the string cannot
Expand Down

0 comments on commit f2018b7

Please sign in to comment.