pull: Add TAG_OVERRIDES and distinguish gpl-2-compatible from gpl-3-compatible
authorW. Trevor King <wking@tremily.us>
Tue, 24 Oct 2017 04:09:05 +0000 (21:09 -0700)
committerW. Trevor King <wking@tremily.us>
Tue, 24 Oct 2017 04:19:32 +0000 (21:19 -0700)
From [1]:

  Unless otherwise specified, compatible licenses are compatible with
  both GPLv2 and GPLv3.

For AGPLv3.0 [2]:

  Please note that the GNU AGPL is not compatible with GPLv2.  It is
  also technically not compatible with GPLv3 in a strict sense: you
  cannot take code released under the GNU AGPL and convey or modify it
  however you like under the terms of GPLv3, or vice versa.  However,
  you are allowed to combine separate modules or source files released
  under both of those licenses in a single project, which will provide
  many programmers with all the permission they need to make the
  programs they want.

I'm not clear on what the idea with "technically not compatible" was.
The vice versa thing sounds is certainly not true for Expat,
etc. either, and Expat is listed as compatible without qualifications.

For ECL2.0 [3]:

  This is a free software license, and it is compatible with
  GPLv3... This patent license and the indemnification clause in
  section 9 make this license incompatible with GPLv2.

For freetype [4]:

  This is a free software license, and compatible with GPLv3.  It has
  some attribution requirements which make it incompatible with GPLv2.

For GNUGPLv3 [5]:

  Please note that GPLv3 is not compatible with GPLv2 by itself.
  However, most software released under GPLv2 allows you to use the
  terms of later versions of the GPL as well.  When this is the case,
  you can use the code under GPLv3 to make the desired combination.

For GPLv2 [6]:

  Please note that GPLv2 is, by itself, not compatible with GPLv3.
  However, most software released under GPLv2 allows you to use the
  terms of later versions of the GPL as well.  When this is the case,
  you can use the code under GPLv3 to make the desired combination.

So what they really mean is that GPL-2.0+ is GPL-3.0-compatible.
GPL-2.0 (only) is GPL-3.0-incompatible.

For LGPLv3 [7]:

  Please note that LGPLv3 is not compatible with GPLv2 by itself.
  However, most software released under GPLv2 allows you to use the
  terms of later versions of the GPL as well.  When this is the case,
  you can use the code under GPLv3 to make the desired combination.

[1]: https://www.gnu.org/licenses/license-list.html#Introduction
[2]: https://www.gnu.org/licenses/license-list.html#AGPLv3.0
[3]: https://www.gnu.org/licenses/license-list.html#ECL2.0
[4]: https://www.gnu.org/licenses/license-list.html#freetype
[5]: https://www.gnu.org/licenses/license-list.html#GNUGPLv3
[6]: https://www.gnu.org/licenses/license-list.html#GPLv2
[7]: https://www.gnu.org/licenses/license-list.html#LGPLv3

pull.py

diff --git a/pull.py b/pull.py
index 35df293fef20c36a478de2f7013f64b4f3bac705..cd92dd85966b413270bc4242202b28565ea06ed7 100755 (executable)
--- a/pull.py
+++ b/pull.py
@@ -19,7 +19,7 @@ URI = 'https://www.gnu.org/licenses/license-list.html'
 
 TAGS = {
     'blue': {'viewpoint'},
-    'green': {'glp-compatible', 'libre'},
+    'green': {'gpl-2-compatible', 'gpl-3-compatible', 'libre'},
     'orange': {'libre'},
     'purple': {'fdl-compatible', 'libre'},
     'red': {'non-free'},
@@ -80,6 +80,15 @@ SPLITS = {
     ],
 }
 
+TAG_OVERRIDES = {
+    'AGPLv3.0': {'libre', 'gpl-3-compatible'},
+    'ECL2.0': {'libre', 'gpl-3-compatible'},
+    'freetype': {'libre', 'gpl-3-compatible'},
+    'GNUGPLv3': {'libre', 'gpl-3-compatible'},
+    'GPLv2': {'libre', 'gpl-2-compatible'},
+    'LGPLv3': {'libre', 'gpl-3-compatible'},
+}
+
 IDENTIFIERS = {
     'AGPLv1.0': {'spdx': 'AGPL-1.0'},
     'AGPLv3.0': {'spdx': 'AGPL-3.0'},
@@ -226,7 +235,7 @@ def extract(root, base_uri=None):
             oids.add(oid)
             for id in SPLITS.get(oid, [oid]):
                 license = {
-                    'tags': tags.copy(),
+                    'tags': TAG_OVERRIDES.get(id, tags).copy(),
                 }
                 if a.text and a.text.strip():
                     license['name'] = a.text.strip()