changeset 39136:25eedd702b46

more fixes regarding --lgpl option
author Dmitry Selyutin <ghostmansd@gmail.com>
date Thu, 05 Jul 2018 21:57:52 +0300
parents 01e983399117
children 6289200390d5
files pygnulib/config.py pygnulib/generator.py
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pygnulib/config.py	Thu Jul 05 22:25:36 2018 +0300
+++ b/pygnulib/config.py	Thu Jul 05 21:57:52 2018 +0300
@@ -520,7 +520,7 @@
             match = pattern.findall(data)
             if match and key not in explicit:
                 if key == "licenses":
-                    self[key] = {
+                    self["licenses"] = {
                         "2": LGPLv2_LICENSE,
                         "3": LGPLv3_LICENSE,
                         "yes": LGPL_LICENSES,
--- a/pygnulib/generator.py	Thu Jul 05 22:25:36 2018 +0300
+++ b/pygnulib/generator.py	Thu Jul 05 21:57:52 2018 +0300
@@ -446,8 +446,9 @@
             yield option
     for module in config.avoids:
         yield f"--avoid={module}"
-    if tuple(config.licenses) in _LGPL:
-        lgpl = _LGPL[tuple(config.licenses)]
+    licenses = tuple(sorted(config.licenses))
+    if licenses in _LGPL:
+        lgpl = _LGPL[licenses]
         if lgpl != "yes":
             yield f"--lgpl={lgpl}"
         else:
@@ -942,8 +943,9 @@
     if config.tests:
         yield "gl_WITH_TESTS"
     yield "gl_LIB([{}])".format(config.libname)
-    if tuple(config.licenses) in _LGPL:
-        lgpl = _LGPL[tuple(sorted(config.licenses))]
+    licenses = tuple(sorted(config.licenses))
+    if licenses in _LGPL:
+        lgpl = _LGPL[licenses]
         if lgpl != "yes":
             yield f"gl_LGPL([{lgpl}])"
         else: