Skip to content

licensepkg: support `+` in license expressions

Pekka Ristola requested to merge pekkarr/namcap:licensepkg-plus into master

Fixes #71

With this change, + SPDX operator is allowed for all license identifiers except those that end with -only or -or-later. Syntactically the SPDX specification allows using the operator for any license identifier, but semantically it doesn't make sense to use it for licenses like GPL-2.0-only+. Such uses will be reported as unknown license identifiers.

While there are other licenses that could probably be disallowed like MIT+, it's hard to draw the line on which identifers should support the + operator. The SPDX specification doesn't provide that information, see https://github.com/spdx/spdx-spec/issues/689

The functionality is implemented by removing trailing + from the license symbols, since the python license_expression module doesn't support parsing it directly. See https://github.com/nexB/license-expression/issues/9

Merge request reports