* [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later
@ 2018-08-16 18:26 Joe Perches
2018-08-17 6:52 ` Christoph Hellwig
2018-08-17 11:37 ` Jonathan Corbet
0 siblings, 2 replies; 4+ messages in thread
From: Joe Perches @ 2018-08-16 18:26 UTC (permalink / raw)
To: Linus Torvalds, linux-kernel
Cc: Thomas Gleixner, Kate Stewart, Greg Kroah-Hartman,
Christoph Hellwig, Russell King, Rob Herring, Jonas Oberg,
Andrew Morton, Jonathan Corbet, linux-doc
The current linux-kernel source git tree has a mixture of the deprecated
spdx version 2 and the newer version 3 uses.
Update the process/license-rules.rst file to show only the version 3 style
and use only the version 3 styles in LICENSES.
Add a script to update all old versions in the tree as well.
I suggest this be applied and the script be run and applied immediately
after an -rc1. The script could also be used at any time after the initial
use to update any other deprecated spdx license uses.
Signed-off-by: Joe Perches <joe@perches.com>
---
Documentation/process/license-rules.rst | 60 ++++++++++++++++-----------------
LICENSES/preferred/GPL-2.0 | 6 ----
LICENSES/preferred/LGPL-2.0 | 8 ++---
LICENSES/preferred/LGPL-2.1 | 8 ++---
scripts/update_spdx_v2_licenses.sh | 15 +++++++++
5 files changed, 53 insertions(+), 44 deletions(-)
create mode 100755 scripts/update_spdx_v2_licenses.sh
diff --git a/Documentation/process/license-rules.rst b/Documentation/process/license-rules.rst
index 8ea26325fe3f..2b294611b6c1 100644
--- a/Documentation/process/license-rules.rst
+++ b/Documentation/process/license-rules.rst
@@ -16,12 +16,12 @@ The license described in the COPYING file applies to the kernel source
as a whole, though individual source files can have a different license
which is required to be compatible with the GPL-2.0::
- GPL-1.0+ : GNU General Public License v1.0 or later
- GPL-2.0+ : GNU General Public License v2.0 or later
- LGPL-2.0 : GNU Library General Public License v2 only
- LGPL-2.0+ : GNU Library General Public License v2 or later
- LGPL-2.1 : GNU Lesser General Public License v2.1 only
- LGPL-2.1+ : GNU Lesser General Public License v2.1 or later
+ GPL-1.0-or-later : GNU General Public License v1.0 or later
+ GPL-2.0-or-later : GNU General Public License v2.0 or later
+ LGPL-2.0-only : GNU Library General Public License v2 only
+ LGPL-2.0-or-later : GNU Library General Public License v2 or later
+ LGPL-2.1-only : GNU Lesser General Public License v2.1 only
+ LGPL-2.1-or-later : GNU Lesser General Public License v2.1 or later
Aside from that, individual files can be provided under a dual license,
e.g. one of the compatible GPL variants and alternatively under a
@@ -98,21 +98,21 @@ License identifier syntax
"(", ")" .
License identifiers for licenses like [L]GPL with the 'or later' option
- are constructed by using a "+" for indicating the 'or later' option.::
+ are constructed by using the '-or-later' option.::
- // SPDX-License-Identifier: GPL-2.0+
- // SPDX-License-Identifier: LGPL-2.1+
+ // SPDX-License-Identifier: GPL-2.0-or-later
+ // SPDX-License-Identifier: LGPL-2.1-or-later
WITH should be used when there is a modifier to a license needed.
For example, the linux kernel UAPI files use the expression::
- // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
- // SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note
+ // SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note
+ // SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note
Other examples using WITH exceptions found in the kernel are::
- // SPDX-License-Identifier: GPL-2.0 WITH mif-exception
- // SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0
+ // SPDX-License-Identifier: GPL-2.0-only WITH mif-exception
+ // SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
Exceptions can only be used with particular License identifiers. The
valid License identifiers are listed in the tags of the exception text
@@ -123,28 +123,28 @@ License identifier syntax
to be selected. For example, some dtsi files are available under dual
licenses::
- // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+ // SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
Examples from the kernel for license expressions in dual licensed files::
- // SPDX-License-Identifier: GPL-2.0 OR MIT
- // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
- // SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
- // SPDX-License-Identifier: GPL-2.0 OR MPL-1.1
- // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT
- // SPDX-License-Identifier: GPL-1.0+ OR BSD-3-Clause OR OpenSSL
+ // SPDX-License-Identifier: GPL-2.0-only OR MIT
+ // SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+ // SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0
+ // SPDX-License-Identifier: GPL-2.0-only OR MPL-1.1
+ // SPDX-License-Identifier: (GPL-2.0-only WITH Linux-syscall-note) OR MIT
+ // SPDX-License-Identifier: GPL-1.0-or-later OR BSD-3-Clause OR OpenSSL
AND should be used if the file has multiple licenses whose terms all
apply to use the file. For example, if code is inherited from another
project and permission has been given to put it in the kernel, but the
original license terms need to remain in effect::
- // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT
+ // SPDX-License-Identifier: (GPL-2.0-only WITH Linux-syscall-note) AND MIT
Another other example where both sets of license terms need to be
adhered to is::
- // SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+
+ // SPDX-License-Identifier: GPL-1.0-or-later AND LGPL-2.1-or-later
License identifiers
-------------------
@@ -168,7 +168,7 @@ kernel, can be broken down into:
Examples::
- LICENSES/preferred/GPL-2.0
+ LICENSES/preferred/GPL-2.0-only
Contains the GPL version 2 license text and the required metatags::
@@ -204,17 +204,17 @@ kernel, can be broken down into:
File format examples::
- Valid-License-Identifier: GPL-2.0
- Valid-License-Identifier: GPL-2.0+
- SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
+ Valid-License-Identifier: GPL-2.0-only
+ Valid-License-Identifier: GPL-2.0-or-later
+ SPDX-URL: https://spdx.org/licenses/GPL-2.0-only.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU General Public License (GPL) version 2 only' use:
- SPDX-License-Identifier: GPL-2.0
+ SPDX-License-Identifier: GPL-2.0-only
For 'GNU General Public License (GPL) version 2 or any later version' use:
- SPDX-License-Identifier: GPL-2.0+
+ SPDX-License-Identifier: GPL-2.0-or-later
License-Text:
Full license text
@@ -338,7 +338,7 @@ kernel, can be broken down into:
SPDX-Exception-Identifier: Linux-syscall-note
SPDX-URL: https://spdx.org/licenses/Linux-syscall-note.html
- SPDX-Licenses: GPL-2.0, GPL-2.0+, GPL-1.0+, LGPL-2.0, LGPL-2.0+, LGPL-2.1, LGPL-2.1+
+ SPDX-Licenses: GPL-2.0-only, GPL-2.0-or-later, GPL-1.0-or-later, LGPL-2.0-only, LGPL-2.0-or-later, LGPL-2.1-only, LGPL-2.1-or-later
Usage-Guidance:
This exception is used together with one of the above SPDX-Licenses
to mark user-space API (uapi) header files so they can be included
@@ -353,7 +353,7 @@ kernel, can be broken down into:
SPDX-Exception-Identifier: GCC-exception-2.0
SPDX-URL: https://spdx.org/licenses/GCC-exception-2.0.html
- SPDX-Licenses: GPL-2.0, GPL-2.0+
+ SPDX-Licenses: GPL-2.0-only, GPL-2.0-or-later
Usage-Guidance:
The "GCC Runtime Library exception 2.0" is used together with one
of the above SPDX-Licenses for code imported from the GCC runtime
diff --git a/LICENSES/preferred/GPL-2.0 b/LICENSES/preferred/GPL-2.0
index ff0812fd89cc..cabbb1779d45 100644
--- a/LICENSES/preferred/GPL-2.0
+++ b/LICENSES/preferred/GPL-2.0
@@ -1,6 +1,4 @@
-Valid-License-Identifier: GPL-2.0
Valid-License-Identifier: GPL-2.0-only
-Valid-License-Identifier: GPL-2.0+
Valid-License-Identifier: GPL-2.0-or-later
SPDX-URL: https://spdx.org/licenses/GPL-2.0.html
Usage-Guide:
@@ -8,12 +6,8 @@ Usage-Guide:
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU General Public License (GPL) version 2 only' use:
- SPDX-License-Identifier: GPL-2.0
- or
SPDX-License-Identifier: GPL-2.0-only
For 'GNU General Public License (GPL) version 2 or any later version' use:
- SPDX-License-Identifier: GPL-2.0+
- or
SPDX-License-Identifier: GPL-2.0-or-later
License-Text:
diff --git a/LICENSES/preferred/LGPL-2.0 b/LICENSES/preferred/LGPL-2.0
index 957d798fe037..443c5569c4f5 100644
--- a/LICENSES/preferred/LGPL-2.0
+++ b/LICENSES/preferred/LGPL-2.0
@@ -1,15 +1,15 @@
-Valid-License-Identifier: LGPL-2.0
-Valid-License-Identifier: LGPL-2.0+
+Valid-License-Identifier: LGPL-2.0-only
+Valid-License-Identifier: LGPL-2.0-or-later
SPDX-URL: https://spdx.org/licenses/LGPL-2.0.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU Library General Public License (LGPL) version 2.0 only' use:
- SPDX-License-Identifier: LGPL-2.0
+ SPDX-License-Identifier: LGPL-2.0-only
For 'GNU Library General Public License (LGPL) version 2.0 or any later
version' use:
- SPDX-License-Identifier: LGPL-2.0+
+ SPDX-License-Identifier: LGPL-2.0-or-later
License-Text:
GNU LIBRARY GENERAL PUBLIC LICENSE
diff --git a/LICENSES/preferred/LGPL-2.1 b/LICENSES/preferred/LGPL-2.1
index 27bb4342a3e8..8738a8d578fa 100644
--- a/LICENSES/preferred/LGPL-2.1
+++ b/LICENSES/preferred/LGPL-2.1
@@ -1,15 +1,15 @@
-Valid-License-Identifier: LGPL-2.1
-Valid-License-Identifier: LGPL-2.1+
+Valid-License-Identifier: LGPL-2.1-only
+Valid-License-Identifier: LGPL-2.1-or-later
SPDX-URL: https://spdx.org/licenses/LGPL-2.1.html
Usage-Guide:
To use this license in source code, put one of the following SPDX
tag/value pairs into a comment according to the placement
guidelines in the licensing rules documentation.
For 'GNU Lesser General Public License (LGPL) version 2.1 only' use:
- SPDX-License-Identifier: LGPL-2.1
+ SPDX-License-Identifier: LGPL-2.1-only
For 'GNU Lesser General Public License (LGPL) version 2.1 or any later
version' use:
- SPDX-License-Identifier: LGPL-2.1+
+ SPDX-License-Identifier: LGPL-2.1-or-later
License-Text:
GNU LESSER GENERAL PUBLIC LICENSE
diff --git a/scripts/update_spdx_v2_licenses.sh b/scripts/update_spdx_v2_licenses.sh
new file mode 100755
index 000000000000..4d422cab600a
--- /dev/null
+++ b/scripts/update_spdx_v2_licenses.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# GPL variants without \+ that should use -only
+
+spdx_find='(SPDX-License-Identifier:\s[\s\(]*.*\bL?GPL-[12].[01])(\s|\)|$)'
+spdx_replace='\1-only\2'
+git grep -P --name-only "$spdx_find" -- './*' ':(exclude)LICENSES/' | \
+ xargs -r perl -p -i -e "s/$spdx_find/$spdx_replace/"
+
+# GPL variants with \+ that should use -or-later
+
+spdx_find='(SPDX-License-Identifier:\s[\s\(]*.*\bL?GPL-[12].[01])\+(\s|\)|$)'
+spdx_replace='\1-or-later\2'
+git grep -P --name-only "$spdx_find" -- './*' ':(exclude)LICENSES/' | \
+ xargs -r perl -p -i -e "s/$spdx_find/$spdx_replace/"
--
2.15.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later
2018-08-16 18:26 [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later Joe Perches
@ 2018-08-17 6:52 ` Christoph Hellwig
2018-08-17 11:37 ` Jonathan Corbet
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2018-08-17 6:52 UTC (permalink / raw)
To: Joe Perches
Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, Kate Stewart,
Greg Kroah-Hartman, Christoph Hellwig, Russell King, Rob Herring,
Jonas Oberg, Andrew Morton, Jonathan Corbet, linux-doc
On Thu, Aug 16, 2018 at 11:26:03AM -0700, Joe Perches wrote:
> The current linux-kernel source git tree has a mixture of the deprecated
> spdx version 2 and the newer version 3 uses.
>
> Update the process/license-rules.rst file to show only the version 3 style
> and use only the version 3 styles in LICENSES.
IF we _only_ document version 3 style we also need to switch every file
over to use it, otherwise we end up in a situation with undocumented tags
again. So if we want to apply your patch we aso need to run your included
script. With a run of that script:
Acked-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later
2018-08-16 18:26 [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later Joe Perches
2018-08-17 6:52 ` Christoph Hellwig
@ 2018-08-17 11:37 ` Jonathan Corbet
2018-08-17 16:02 ` Joe Perches
1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2018-08-17 11:37 UTC (permalink / raw)
To: Joe Perches
Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, Kate Stewart,
Greg Kroah-Hartman, Christoph Hellwig, Russell King, Rob Herring,
Jonas Oberg, Andrew Morton, linux-doc
On Thu, 16 Aug 2018 11:26:03 -0700
Joe Perches <joe@perches.com> wrote:
> The current linux-kernel source git tree has a mixture of the deprecated
> spdx version 2 and the newer version 3 uses.
>
> Update the process/license-rules.rst file to show only the version 3 style
> and use only the version 3 styles in LICENSES.
>
> Add a script to update all old versions in the tree as well.
>
> I suggest this be applied and the script be run and applied immediately
> after an -rc1. The script could also be used at any time after the initial
> use to update any other deprecated spdx license uses.
All seems OK to me, with one question: if we're going to run the script
and fix everything up, do we really need to add that script to the tree
as well? It seems like something we shouldn't need again.
If we *do* keep it for some reason, it needs a comment saying what it
does and why it exists.
Thanks,
jon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later
2018-08-17 11:37 ` Jonathan Corbet
@ 2018-08-17 16:02 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2018-08-17 16:02 UTC (permalink / raw)
To: Jonathan Corbet
Cc: Linus Torvalds, linux-kernel, Thomas Gleixner, Kate Stewart,
Greg Kroah-Hartman, Christoph Hellwig, Russell King, Rob Herring,
Jonas Oberg, Andrew Morton, linux-doc
On Fri, 2018-08-17 at 05:37 -0600, Jonathan Corbet wrote:
> On Thu, 16 Aug 2018 11:26:03 -0700
> Joe Perches <joe@perches.com> wrote:
>
> > The current linux-kernel source git tree has a mixture of the deprecated
> > spdx version 2 and the newer version 3 uses.
> >
> > Update the process/license-rules.rst file to show only the version 3 style
> > and use only the version 3 styles in LICENSES.
> >
> > Add a script to update all old versions in the tree as well.
> >
> > I suggest this be applied and the script be run and applied immediately
> > after an -rc1. The script could also be used at any time after the initial
> > use to update any other deprecated spdx license uses.
>
> All seems OK to me, with one question: if we're going to run the script
> and fix everything up, do we really need to add that script to the tree
> as well? It seems like something we shouldn't need again.
linux-next has other files with licenses that would need to be
updated even after an -rc1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-08-17 16:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-16 18:26 [PATCH] license-rules.rst and LICENSES: Use only spdx version 3 with -only and -or-later Joe Perches
2018-08-17 6:52 ` Christoph Hellwig
2018-08-17 11:37 ` Jonathan Corbet
2018-08-17 16:02 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).