From: Dmitry Selyutin Date: Sun, 1 Jul 2018 22:02:02 +0000 (+0300) Subject: generator: make licenses hashable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff91f9b80e4eac300ed2f5391f19d0d2e9453ad;p=thirdparty%2Fgnulib.git generator: make licenses hashable --- diff --git a/pygnulib/generator.py b/pygnulib/generator.py index 95ffe4607a..3cbb13a6dc 100644 --- a/pygnulib/generator.py +++ b/pygnulib/generator.py @@ -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: