From b6aaa1ed2ef141605363315191ab5ea538ace3cc Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Mon, 1 May 2023 12:27:47 +0900 Subject: [PATCH 1/6] =?UTF-8?q?Add:=20=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E9=81=95=E5=8F=8D=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_licenses.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/generate_licenses.py b/generate_licenses.py index da41db0c0..7da38d836 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -7,6 +7,11 @@ from typing import List, Optional +class LicenseError(Exception): + # License違反があった場合、このエラーを出します。 + pass + + @dataclass class License: name: str @@ -162,6 +167,8 @@ def generate_licenses() -> List[License]: license=license_json["License"], text=license_json["LicenseText"], ) + if license.license == "GPL": + raise LicenseError(f"ライセンス違反: {license.name}") # FIXME: assert license type if license.text == "UNKNOWN": if license.name.lower() == "core" and license.version == "0.0.0": From 3129a8d996c47e7f71492e24e47c93e89bd801aa Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Mon, 1 May 2023 07:49:42 +0000 Subject: [PATCH 2/6] e --- generate_licenses.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/generate_licenses.py b/generate_licenses.py index 7da38d836..081620158 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -167,8 +167,18 @@ def generate_licenses() -> List[License]: license=license_json["License"], text=license_json["LicenseText"], ) - if license.license == "GPL": - raise LicenseError(f"ライセンス違反: {license.name}") + # print(license.license) + license_names = license.license.split("; ") + for license_name in license_names: + print(f"'{license_name}'") + if license_name in [ + "GNU General Public License v2 (GPLv2)", + "GNU General Public License (GPL)", + "GNU General Public License v3 (GPLv3)", + "GNU Affero General Public License v3 (AGPL-3)", + "GNU Lesser General Public License v2 (LGPLv2)" + ] and license_name != "pyinstaller": + raise LicenseError(f"ライセンス違反: {license.name}") # FIXME: assert license type if license.text == "UNKNOWN": if license.name.lower() == "core" and license.version == "0.0.0": From ab487e045715f93f173db6215b0aece46636763f Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Tue, 2 May 2023 10:58:28 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=E5=AE=8C=E6=88=90=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_licenses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_licenses.py b/generate_licenses.py index 081620158..918cc5cd2 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -177,7 +177,7 @@ def generate_licenses() -> List[License]: "GNU General Public License v3 (GPLv3)", "GNU Affero General Public License v3 (AGPL-3)", "GNU Lesser General Public License v2 (LGPLv2)" - ] and license_name != "pyinstaller": + ]: raise LicenseError(f"ライセンス違反: {license.name}") # FIXME: assert license type if license.text == "UNKNOWN": From d183dfb758791d69d69ca64cba30071174345a64 Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Tue, 2 May 2023 10:58:43 +0000 Subject: [PATCH 4/6] =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_licenses.py | 1 - 1 file changed, 1 deletion(-) diff --git a/generate_licenses.py b/generate_licenses.py index 918cc5cd2..b39caeaae 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -170,7 +170,6 @@ def generate_licenses() -> List[License]: # print(license.license) license_names = license.license.split("; ") for license_name in license_names: - print(f"'{license_name}'") if license_name in [ "GNU General Public License v2 (GPLv2)", "GNU General Public License (GPL)", From f0d096d5348d718ce44e6d4c5c8062b7b8385f97 Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Tue, 2 May 2023 11:00:57 +0000 Subject: [PATCH 5/6] =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_licenses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_licenses.py b/generate_licenses.py index b39caeaae..a0d6e0072 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -175,7 +175,7 @@ def generate_licenses() -> List[License]: "GNU General Public License (GPL)", "GNU General Public License v3 (GPLv3)", "GNU Affero General Public License v3 (AGPL-3)", - "GNU Lesser General Public License v2 (LGPLv2)" + "GNU Lesser General Public License v2 (LGPLv2)", ]: raise LicenseError(f"ライセンス違反: {license.name}") # FIXME: assert license type From 2fc3cbf25885935b95b8a4fa4cf925801f1c4665 Mon Sep 17 00:00:00 2001 From: mc_fdc Date: Tue, 2 May 2023 11:02:57 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generate_licenses.py | 1 - 1 file changed, 1 deletion(-) diff --git a/generate_licenses.py b/generate_licenses.py index a0d6e0072..9b72a2ce7 100644 --- a/generate_licenses.py +++ b/generate_licenses.py @@ -167,7 +167,6 @@ def generate_licenses() -> List[License]: license=license_json["License"], text=license_json["LicenseText"], ) - # print(license.license) license_names = license.license.split("; ") for license_name in license_names: if license_name in [