-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from github/elr/license-updates
update license lists from official spdx data
- Loading branch information
Showing
12 changed files
with
7,903 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","bzip2-1.0.5","eCos-2.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-1.0+","GPL-2.0","GPL-2.0+","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0","GPL-3.0+","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","LGPL-2.0","LGPL-2.0+","LGPL-2.1","LGPL-2.1+","LGPL-3.0","LGPL-3.0+","Nunit","StandardML-NJ","wxWindows"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"AGPL-1.0", | ||
"AGPL-3.0", | ||
"BSD-2-Clause-FreeBSD", | ||
"BSD-2-Clause-NetBSD", | ||
"bzip2-1.0.5", | ||
"eCos-2.0", | ||
"GFDL-1.1", | ||
"GFDL-1.2", | ||
"GFDL-1.3", | ||
"GPL-1.0", | ||
"GPL-1.0+", | ||
"GPL-2.0", | ||
"GPL-2.0+", | ||
"GPL-2.0-with-autoconf-exception", | ||
"GPL-2.0-with-bison-exception", | ||
"GPL-2.0-with-classpath-exception", | ||
"GPL-2.0-with-font-exception", | ||
"GPL-2.0-with-GCC-exception", | ||
"GPL-3.0", | ||
"GPL-3.0+", | ||
"GPL-3.0-with-autoconf-exception", | ||
"GPL-3.0-with-GCC-exception", | ||
"LGPL-2.0", | ||
"LGPL-2.0+", | ||
"LGPL-2.1", | ||
"LGPL-2.1+", | ||
"LGPL-3.0", | ||
"LGPL-3.0+", | ||
"Nunit", | ||
"StandardML-NJ", | ||
"wxWindows", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["389-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-3.1","gnu-javamail-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","Libtool-exception","Linux-syscall-note","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SHL-2.0","SHL-2.1","Swift-exception","u-boot-exception-2.0","Universal-FOSS-exception-1.0","WxWindows-exception-3.1","x11vnc-openssl-exception"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"389-exception", | ||
"Autoconf-exception-2.0", | ||
"Autoconf-exception-3.0", | ||
"Bison-exception-2.2", | ||
"Bootloader-exception", | ||
"Classpath-exception-2.0", | ||
"CLISP-exception-2.0", | ||
"DigiRule-FOSS-exception", | ||
"eCos-exception-2.0", | ||
"Fawkes-Runtime-exception", | ||
"FLTK-exception", | ||
"Font-exception-2.0", | ||
"freertos-exception-2.0", | ||
"GCC-exception-2.0", | ||
"GCC-exception-3.1", | ||
"gnu-javamail-exception", | ||
"GPL-3.0-linking-exception", | ||
"GPL-3.0-linking-source-exception", | ||
"GPL-CC-1.0", | ||
"GStreamer-exception-2005", | ||
"GStreamer-exception-2008", | ||
"i2p-gpl-java-exception", | ||
"KiCad-libraries-exception", | ||
"LGPL-3.0-linking-exception", | ||
"Libtool-exception", | ||
"Linux-syscall-note", | ||
"LLVM-exception", | ||
"LZMA-exception", | ||
"mif-exception", | ||
"OCaml-LGPL-linking-exception", | ||
"OCCT-exception-1.0", | ||
"OpenJDK-assembly-exception-1.0", | ||
"openvpn-openssl-exception", | ||
"PS-or-PDF-font-exception-20170817", | ||
"Qt-GPL-exception-1.0", | ||
"Qt-LGPL-exception-1.1", | ||
"Qwt-exception-1.0", | ||
"SHL-2.0", | ||
"SHL-2.1", | ||
"Swift-exception", | ||
"u-boot-exception-2.0", | ||
"Universal-FOSS-exception-1.0", | ||
"WxWindows-exception-3.1", | ||
"x11vnc-openssl-exception", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"os" | ||
) | ||
|
||
type ExceptionData struct { | ||
Version string `json:"licenseListVersion"` | ||
Exceptions []Exception `json:"exceptions"` | ||
} | ||
|
||
type Exception struct { | ||
Reference string `json:"reference"` | ||
IsDeprecated bool `json:"isDeprecatedLicenseId"` | ||
DetailsURL string `json:"detailsUrl"` | ||
ReferenceNumber int `json:"referenceNumber"` | ||
Name string `json:"name"` | ||
LicenseID string `json:"licenseExceptionId"` | ||
SeeAlso []string `json:"seeAlso"` | ||
IsOsiApproved bool `json:"isOsiApproved"` | ||
} | ||
|
||
// extractExceptionLicenseIDs read official exception licenses file copied from spdx/license-list-data | ||
// and write file exception_license_ids.json containing just the non-deprecated exception license IDs. | ||
// NOTE: For now, this function ignores the deprecated exception licenses. | ||
func extractExceptionLicenseIDs() error { | ||
// open file | ||
file, err := os.Open("exceptions.json") | ||
if err != nil { | ||
fmt.Println(err) | ||
return err | ||
} | ||
|
||
// read in all licenses marshalled into a slice of exception structs | ||
var exceptionData ExceptionData | ||
err = json.NewDecoder(file).Decode(&exceptionData) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// create slice of exception license IDs that are not deprecated | ||
var nonDeprecatedExceptionLicenseIDs []string | ||
for _, e := range exceptionData.Exceptions { | ||
if !e.IsDeprecated { | ||
nonDeprecatedExceptionLicenseIDs = append(nonDeprecatedExceptionLicenseIDs, e.LicenseID) | ||
} | ||
} | ||
|
||
// save non-deprecated license IDs followed by a comma with one per line in file license_ids.txt | ||
nonDeprecatedExceptionLicenseIDsTxt := []byte{} | ||
for _, id := range nonDeprecatedExceptionLicenseIDs { | ||
nonDeprecatedExceptionLicenseIDsTxt = append(nonDeprecatedExceptionLicenseIDsTxt, []byte(" \"")...) | ||
nonDeprecatedExceptionLicenseIDsTxt = append(nonDeprecatedExceptionLicenseIDsTxt, []byte(id)...) | ||
nonDeprecatedExceptionLicenseIDsTxt = append(nonDeprecatedExceptionLicenseIDsTxt, []byte("\",")...) | ||
nonDeprecatedExceptionLicenseIDsTxt = append(nonDeprecatedExceptionLicenseIDsTxt, []byte("\n")...) | ||
} | ||
err = ioutil.WriteFile("exception_ids.txt", nonDeprecatedExceptionLicenseIDsTxt, 0600) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// save non-deprecated license IDs to json array in file exception_ids.json | ||
nonDeprecatedExceptionLicenseIDsJSON, err := json.Marshal(nonDeprecatedExceptionLicenseIDs) | ||
if err != nil { | ||
return err | ||
} | ||
err = ioutil.WriteFile("exception_ids.json", nonDeprecatedExceptionLicenseIDsJSON, 0600) | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
Oops, something went wrong.