From f2018b7dccefd86689e1902bfc5d02648bdfd71d Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Mon, 6 May 2024 11:45:53 +0200 Subject: [PATCH] fix(spdx): Accept "additional-terms" as part of LicenseRef exceptions 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 --- utils/spdx/src/main/kotlin/SpdxExpression.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/spdx/src/main/kotlin/SpdxExpression.kt b/utils/spdx/src/main/kotlin/SpdxExpression.kt index 33d3db1dcaabc..82fc50b274a91 100644 --- a/utils/spdx/src/main/kotlin/SpdxExpression.kt +++ b/utils/spdx/src/main/kotlin/SpdxExpression.kt @@ -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