From aaa61906331d1d614167ca75591e9ff404933455 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 12 Jan 2018 10:59:32 -0800 Subject: [PATCH] schema/ListedLicense: Add obsoletedBy to licenses and exceptions From [1]: As a result, a number of licenses formerly included in the SPDX License List have been deprecated as licenses, and correct usage employs the License Expression Syntax as of v2.0. So the sole reason for the deprecations seems to be "there's a better way to say that now". Telling people "use an expression instead" is less useful than saying "use this expression instead: $SOME_EXPRESSION". This commit updates the schema to allow us to recommend replacements. Consumers can use logic like: 1. Parse a license expression to extract the short identifiers. 2. Look up obsoletedBy entries for the short identifiers. 3. If any obsoletedBy has an 'expression' attribute that matches the source, the value of that obsoletedBy is the recommended replacement for that expression. Otherwise, the value of the obsoletedBy without an expression attribute is the recommended replacement for the short identifier. For example, the expression: GPL-2.0+ WITH GCC-exception-2.0 could be parsed to either of the following short license identifiers: * GPL-2.0+, in which case there would be a single obsoletedBy with no expression attribute: GPL-2.0-or-later So the recommended replacement for GPL-2.0+ would be GPL-2.0-or-later. * GPL-2.0, in which case there would be two obsoletedBy values: GPL-2.0-only GPL-2.0-or-later The one with an 'expression' attribute set to 'GPL-2.0+' matches the source, so the recommended replacement for GPL-2.0+ is GPL-2.0-or-later. The presence of an obsoletedBy element is sufficient to mark a license/expression obsolete (as is the presence of an deprecatedVersion attribute), so I'm in favor of dropping isDeprecated to stay DRY. However, removing isDeprecated (from this repository, we would still supply it in license-list-data) has proven contentious for reasons I don't understand. This commit punts on the removal for now [2]. [1]: https://github.com/spdx/license-list-XML/pull/392#issuecomment-357314284 [2]: https://github.com/spdx/license-list-XML/pull/392#issuecomment-357314284 --- schema/ListedLicense.xsd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/schema/ListedLicense.xsd b/schema/ListedLicense.xsd index b5b2c5d195..025ecd36b1 100644 --- a/schema/ListedLicense.xsd +++ b/schema/ListedLicense.xsd @@ -19,6 +19,7 @@ + @@ -38,6 +39,7 @@ + @@ -61,6 +63,9 @@ + + +