Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPLライセンス違反確認を追加しました。 #1141

Merged
merged 9 commits into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions build_util/generate_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from typing import List, Optional


class LicenseError(Exception):
# License違反があった場合、このエラーを出します。
pass


@dataclass
class License:
name: str
Expand Down Expand Up @@ -162,6 +167,16 @@ def generate_licenses() -> List[License]:
license=license_json["License"],
text=license_json["LicenseText"],
)
license_names_str = license.license or ""
license_names = license_names_str.split("; ")
for license_name in license_names:
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)",
]:
raise LicenseError(f"ライセンス違反: {license.name}")
# FIXME: assert license type
if license.text == "UNKNOWN":
if license.name.lower() == "core" and license.version == "0.0.0":
Expand Down
Loading