Fix: SPDX-compliance
This commit is contained in:
		
							parent
							
								
									0d705b9727
								
							
						
					
					
						commit
						6c4b464f14
					
				
					 73 changed files with 98 additions and 81 deletions
				
			
		|  | @ -30,7 +30,7 @@ License: GPL-3.0-or-later | |||
| Files: public/assets/templates/*.js public/assets/fonts/*.js | ||||
| Copyright: MapComplete contributors | ||||
| Comment: fonts for exports | ||||
| License: UBUNTU-FONT-LICENSE | ||||
| License: LicenseRef-UBUNTU-FONT-LICENSE | ||||
| 
 | ||||
| 
 | ||||
| Files: public/assets/*.svg public/assets/*.png public/apple_touch_icon.png | ||||
|  |  | |||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Turvec Solutions | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: ©Altinnova | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: European Vegetarian Union | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Agentschap Natuur en Bos | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Natuurpunt | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Groen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Agentschap Natuur en Bos | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: LiberaPay | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Pieter Vander Vennet;  OSM | ||||
| SPDX-License-Identifier: LOGO AND CC-BY-SA-4.0 | ||||
| SPDX-License-Identifier: LicenseRef-LOGO AND CC-BY-SA-4.0 | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Mapillary | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Mapillary | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Mastodon | ||||
| SPDX-License-Identifier: LOGO AND AGPL-3.0-or-later | ||||
| SPDX-License-Identifier: LicenseRef-LOGO AND AGPL-3.0-or-later | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: OpenStreetMap U.S. Chapter | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: https://plantnet.org | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Wikidata | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Wikimedia | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Wikipedia | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Agentschap Natuur en Bos | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Natuurpunt | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Groen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Groen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Groen | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText:  | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: De Vlaamse Provincies | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: De Fietsambassade | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: De Fietsambassade | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: ©UNESCO-UIS 2012 http://www.uis.unesco.org | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  |  | |||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Departement Omgeving, Vlaamse Overheid | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Provincie Antwerpen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Vlaamse Overheid | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  |  | |||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Createlli | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Youtube | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Jo De Baerdemaeker  | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Jo De Baerdemaeker  | ||||
| SPDX-License-Identifier: ALL-RIGHTS-RESERVED | ||||
| SPDX-License-Identifier: LicenseRef-ALL-RIGHTS-RESERVED | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Toerisme Vlaanderen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Toerisme Vlaanderen | ||||
| SPDX-License-Identifier: LOGO | ||||
| SPDX-License-Identifier: LicenseRef-LOGO | ||||
|  | @ -1,2 +1,2 @@ | |||
| SPDX-FileCopyrightText: Pieter Vander Vennet | ||||
| SPDX-License-Identifier: TRIVIAL | ||||
| SPDX-License-Identifier: LicenseRef-TRIVIAL | ||||
|  | @ -4,9 +4,15 @@ import ScriptUtils from "./ScriptUtils" | |||
| import Script from "./Script" | ||||
| import { Utils } from "../src/Utils" | ||||
| 
 | ||||
| const prompt = require("prompt-sync")() | ||||
| 
 | ||||
| export class GenerateLicenseInfo extends Script { | ||||
|     private static readonly needsLicenseRef = new Set( | ||||
|         ScriptUtils.readDirRecSync("./LICENSES") | ||||
|             .map((p) => p.substring(p.lastIndexOf("/") + 1)) | ||||
|             .filter((p) => p.startsWith("LicenseRef-")) | ||||
|             .map((p) => p.substring("LicenseRef-".length)) | ||||
|             .map((p) => p.substring(0, p.lastIndexOf("."))) | ||||
|     ) | ||||
| 
 | ||||
|     constructor() { | ||||
|         super("Validates the licenses and compiles them into one single asset file") | ||||
|     } | ||||
|  | @ -193,11 +199,6 @@ export class GenerateLicenseInfo extends Script { | |||
|      */ | ||||
|     toSPDXCompliantLicense(licenseId: string): string { | ||||
|         licenseId = licenseId.trim() | ||||
|         licenseId = licenseId.replaceAll("-AND-", " AND ") | ||||
| 
 | ||||
|         if (!(licenseId.endsWith("-only") || licenseId.endsWith("-or-later"))) { | ||||
|             licenseId = licenseId.toUpperCase() | ||||
|         } | ||||
|         // https://spdx.org/licenses/
 | ||||
|         const mappings: Record<string, string> = { | ||||
|             "CC-0": "CC0-1.0", | ||||
|  | @ -362,11 +363,10 @@ export class GenerateLicenseInfo extends Script { | |||
| 
 | ||||
|         let invalid = 0 | ||||
|         for (const licenseInfo of licenseInfos) { | ||||
|             const isTrivial = | ||||
|                 licenseInfo.license | ||||
|                     .split(";") | ||||
|                     .map((l) => l.trim().toLowerCase()) | ||||
|                     .indexOf("trivial") >= 0 | ||||
|             const isTrivial = licenseInfo.license | ||||
|                 .split(";") | ||||
|                 .map((l) => l.trim().toLowerCase()) | ||||
|                 .some((s) => s.endsWith("trivial")) | ||||
|             if (licenseInfo.sources.length + licenseInfo.authors.length == 0 && !isTrivial) { | ||||
|                 invalid++ | ||||
|                 invalidLicenses.push( | ||||
|  | @ -393,7 +393,11 @@ export class GenerateLicenseInfo extends Script { | |||
| 
 | ||||
|             const spdxContent = [ | ||||
|                 "SPDX-FileCopyrightText: " + licenseInfo.authors.join("; "), | ||||
|                 "SPDX-License-Identifier: " + licenseInfo.license, | ||||
|                 "SPDX-License-Identifier: " + | ||||
|                     licenseInfo.license | ||||
|                         .split(" AND ") | ||||
|                         .map((s) => this.addLicenseRef(s)) | ||||
|                         .join(" AND "), | ||||
|             ] | ||||
|             writeFileSync(spdxPath, spdxContent.join("\n")) | ||||
|         } | ||||
|  | @ -410,6 +414,19 @@ export class GenerateLicenseInfo extends Script { | |||
|         this.cleanLicenseInfo(licensePaths, licenseInfos) | ||||
|         this.createFullLicenseOverview(licensePaths) | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Some licenses need "LicenseRef-" to be added to make reuse lint work | ||||
|      * @param s | ||||
|      * @private | ||||
|      */ | ||||
|     private addLicenseRef(s: string): string { | ||||
|         if (GenerateLicenseInfo.needsLicenseRef.has(s)) { | ||||
|             console.log("Mapping ", s, Array.from(GenerateLicenseInfo.needsLicenseRef)) | ||||
|             return "LicenseRef-" + s | ||||
|         } | ||||
|         return s | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| new GenerateLicenseInfo().run() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue