From 296146e4f8c3b5f72472a9f38e3c014f14f56306 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 10 Aug 2020 09:32:50 +0200 Subject: [PATCH] [libcalamares] update SPDX licensing on generated files - the scripts are BSD-2-clause, - the generated files are CC0 (I'm not *100%* sure about the derived file CountryData_p.cpp, which lists countries and country codes -- it **is** extracted from CLDR data which is not CC0) --- src/libcalamares/locale/CountryData_p.cpp | 13 +++- src/libcalamares/locale/ZoneData_p.cxxtr | 24 +------ src/libcalamares/locale/cldr-extractor.py | 87 ++++++++--------------- src/libcalamares/locale/zone-extractor.py | 53 +++----------- 4 files changed, 57 insertions(+), 120 deletions(-) diff --git a/src/libcalamares/locale/CountryData_p.cpp b/src/libcalamares/locale/CountryData_p.cpp index 4382950ec..722ee2ba9 100644 --- a/src/libcalamares/locale/CountryData_p.cpp +++ b/src/libcalamares/locale/CountryData_p.cpp @@ -2,7 +2,13 @@ * * === This file is part of Calamares - === * -* This file is derived from CLDR data from Unicode, Inc. Applicable terms: +* SPDX-FileCopyrightText: 1991-2019 Unicode, Inc. +* SPDX-FileCopyrightText: 2019 Adriaan de Groot +* SPDX-License-Identifier: CC0 +* +* This file is derived from CLDR data from Unicode, Inc. Applicable terms +* are listed at http://unicode.org/copyright.html , of which the most +* important are: * * A. Unicode Copyright * 1. Copyright © 1991-2019 Unicode, Inc. All rights reserved. @@ -10,6 +16,11 @@ * Unicode Data Files ("DATA FILES") include all data files under the directories: * https://www.unicode.org/Public/ * C. Terms of Use +* 1. Certain documents and files on this website contain a legend indicating +* that "Modification is permitted." Any person is hereby authorized, +* without fee, to modify such documents and files to create derivative +* works conforming to the Unicode® Standard, subject to Terms and +* Conditions herein. * 2. Any person is hereby authorized, without fee, to view, use, reproduce, * and distribute all documents and files, subject to the Terms and * Conditions herein. diff --git a/src/libcalamares/locale/ZoneData_p.cxxtr b/src/libcalamares/locale/ZoneData_p.cxxtr index 4bfef3c0c..7bbcdf7f6 100644 --- a/src/libcalamares/locale/ZoneData_p.cxxtr +++ b/src/libcalamares/locale/ZoneData_p.cxxtr @@ -1,26 +1,8 @@ /* GENERATED FILE DO NOT EDIT * -* === This file is part of Calamares - === - * - * SPDX-FileCopyrightText: 2019 Adriaan de Groot - * - * Calamares is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Calamares is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Calamares. If not, see . - * - * SPDX-License-Identifier: GPL-3.0-or-later - * License-Filename: LICENSE - * - * +* SPDX-FileCopyrightText: 2009 Arthur David Olson +* SPDX-FileCopyrightText: 2019 Adriaan de Groot +* SPDX-License-Identifier: CC0 * * This file is derived from zone.tab, which has its own copyright statement: * diff --git a/src/libcalamares/locale/cldr-extractor.py b/src/libcalamares/locale/cldr-extractor.py index f69407257..0291abf7d 100644 --- a/src/libcalamares/locale/cldr-extractor.py +++ b/src/libcalamares/locale/cldr-extractor.py @@ -1,45 +1,9 @@ #! /usr/bin/env python3 # # === This file is part of Calamares - === -# +# # SPDX-FileCopyrightText: 2019 Adriaan de Groot -# # SPDX-License-Identifier: BSD-2-Clause -# License-Filename: LICENSES/BSD2 -# -# -# -# Python3 script to scrape some data out of ICU CLDR supplemental data. -# -### BEGIN LICENSES -# -# Copyright 2019 Adriaan de Groot -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -### END LICENSES - -### BEGIN USAGE # """ Python3 script to scrape some data out of ICU CLDR supplemental data. @@ -126,7 +90,7 @@ class CountryData: self.country_code = "" self.language_enum = "AnyLanguage" self.country_enum = "AnyCountry" - + def __str__(self): if self.country_code: char0 = "'{!s}'".format(self.country_code[0]) @@ -134,18 +98,18 @@ class CountryData: else: char0 = "0" char1 = "0" - + return "{!s} QLocale::Language::{!s}, QLocale::Country::{!s}, {!s}, {!s} {!s},".format( "{", - self.language_enum, + self.language_enum, self.country_enum, - char0, + char0, char1, "}") # Must match type name below cpp_classname = "CountryData" - + # Must match the output format of __str__ above cpp_declaration = """ struct CountryData @@ -169,30 +133,30 @@ def extricate_subtags(l1, l2): return if '{ ?; ?;' not in l2: return - + # This is extremely crude "parsing" which chops up the string # by delimiter and then extracts some substring. l1_parts = l1.split("und_") l2_parts = l2.split(";") - + l1_first_quote = l1_parts[1].find('"') l1_code = l1_parts[1][:l1_first_quote] if len(l1_code) != 2: return - + l2_brace = l2_parts[2].find("{") l2_language = l2_parts[2][l2_brace+1:].strip() l2_brace = l2_parts[2].find("}") l2_country = l2_parts[2][:l2_brace-1].strip() - + # Handle mapped cases l2_language = language_mapper.get(l2_language, l2_language) l2_language = l2_language.replace(" ", "") - + # Handle mapped cases and then do a bunch of standard replacements. l2_country = country_mapper.get(l2_country, l2_country) l2_country = l2_country.replace(" ", "").replace("-", "").replace(".","").replace("&","And") - + return CountryData(l1_code, l2_language, l2_country) @@ -213,7 +177,7 @@ def read_subtags_file(): if l1: assert "likelySubtag" in l1, l1; assert "