]> Savannah Git Hosting - gnulib.git/commitdiff
generator: make licenses hashable
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 1 Jul 2018 22:02:02 +0000 (01:02 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sun, 1 Jul 2018 22:02:02 +0000 (01:02 +0300)
pygnulib/generator.py

index 95ffe4607a9ca35de653012c709ab9d307aef5b3..3cbb13a6dccc4d9ecb7da3a3b82fb8dc945de0e9 100644 (file)
@@ -23,10 +23,10 @@ from .module import Database as _Database
 
 
 _LGPL = {
-    _LGPLv2_LICENSE: "2",
-    _LGPLv3_LICENSE: "3",
-    _LGPL_LICENSES: "yes",
-    (_GPLv2_LICENSE | _LGPLv3_LICENSE): "3orGPLv2",
+    tuple(_LGPLv2_LICENSE): "2",
+    tuple(_LGPLv3_LICENSE): "3",
+    tuple(_LGPL_LICENSES): "yes",
+    tuple(_GPLv2_LICENSE | _LGPLv3_LICENSE): "3orGPLv2",
 }
 __DISCLAIMER = (
     "## DO NOT EDIT! GENERATED AUTOMATICALLY!",
@@ -446,8 +446,8 @@ def command_line(config, explicit, **override):
             yield option
     for module in config.avoids:
         yield "--avoid={module.name}"
-    if frozenset(config.licenses) in _LGPL:
-        lgpl = _LGPL[config.licenses]
+    if tuple(config.licenses) in _LGPL:
+        lgpl = _LGPL[tuple(config.licenses)]
         if lgpl != "yes":
             yield f"--lgpl={lgpl}"
         else:
@@ -937,8 +937,8 @@ def gnulib_cache(config, explicit):
     if config.tests:
         yield "gl_WITH_TESTS"
     yield "gl_LIB([{}])".format(config.libname)
-    if frozenset(config.licenses) in _LGPL:
-        lgpl = _LGPL[config.licenses]
+    if tuple(config.licenses) in _LGPL:
+        lgpl = _LGPL[tuple(config.licenses)]
         yield "gl_LGPL([{}])".format(lgpl) if lgpl != "yes" else "gl_LGPL"
     yield f"gl_MAKEFILE_NAME([{config.makefile_name}])"
     if config.conditionals: