| 1 | package spdxlicenses |
| 2 | |
| 3 | // Code generated by go-spdx cmd/license.go. DO NOT EDIT. |
| 4 | // Source: https://github.com/spdx/license-list-data specifies official SPDX license list. |
| 5 | |
| 6 | import "strings" |
| 7 | |
| 8 | // IsDeprecatedLicense does a case-insensitive lookup for the license id in the deprecated licenses map. |
| 9 | // It returns true and the case-sensitive ID if found, otherwise false and the original id. |
| 10 | func IsDeprecatedLicense(id string) (bool, string) { |
| 11 | foundID, ok := deprecatedMap[strings.ToUpper(id)] |
| 12 | if ok { |
| 13 | return true, foundID |
| 14 | } |
| 15 | return false, id |
| 16 | } |
| 17 | |
| 18 | // GetDeprecatedMap returns a map of deprecated license IDs keyed by uppercase ID. |
| 19 | func GetDeprecatedMap() map[string]string { |
| 20 | copied := make(map[string]string, len(deprecatedMap)) |
| 21 | for k, v := range deprecatedMap { |
| 22 | copied[k] = v |
| 23 | } |
| 24 | return copied |
| 25 | } |
| 26 | |
| 27 | // GetDeprecated returns a slice of deprecated license IDs. |
| 28 | func GetDeprecated() []string { |
| 29 | return []string{ |
| 30 | "AGPL-1.0", |
| 31 | "AGPL-3.0", |
| 32 | "BSD-2-Clause-FreeBSD", |
| 33 | "BSD-2-Clause-NetBSD", |
| 34 | "bzip2-1.0.5", |
| 35 | "eCos-2.0", |
| 36 | "GFDL-1.1", |
| 37 | "GFDL-1.2", |
| 38 | "GFDL-1.3", |
| 39 | "GPL-1.0", |
| 40 | "GPL-1.0+", |
| 41 | "GPL-2.0", |
| 42 | "GPL-2.0+", |
| 43 | "GPL-2.0-with-autoconf-exception", |
| 44 | "GPL-2.0-with-bison-exception", |
| 45 | "GPL-2.0-with-classpath-exception", |
| 46 | "GPL-2.0-with-font-exception", |
| 47 | "GPL-2.0-with-GCC-exception", |
| 48 | "GPL-3.0", |
| 49 | "GPL-3.0+", |
| 50 | "GPL-3.0-with-autoconf-exception", |
| 51 | "GPL-3.0-with-GCC-exception", |
| 52 | "LGPL-2.0", |
| 53 | "LGPL-2.0+", |
| 54 | "LGPL-2.1", |
| 55 | "LGPL-2.1+", |
| 56 | "LGPL-3.0", |
| 57 | "LGPL-3.0+", |
| 58 | "Net-SNMP", |
| 59 | "Nunit", |
| 60 | "StandardML-NJ", |
| 61 | "wxWindows", |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | var deprecatedMap = map[string]string{ |
| 66 | "AGPL-1.0": "AGPL-1.0", |
| 67 | "AGPL-3.0": "AGPL-3.0", |
| 68 | "BSD-2-CLAUSE-FREEBSD": "BSD-2-Clause-FreeBSD", |
| 69 | "BSD-2-CLAUSE-NETBSD": "BSD-2-Clause-NetBSD", |
| 70 | "BZIP2-1.0.5": "bzip2-1.0.5", |
| 71 | "ECOS-2.0": "eCos-2.0", |
| 72 | "GFDL-1.1": "GFDL-1.1", |
| 73 | "GFDL-1.2": "GFDL-1.2", |
| 74 | "GFDL-1.3": "GFDL-1.3", |
| 75 | "GPL-1.0": "GPL-1.0", |
| 76 | "GPL-1.0+": "GPL-1.0+", |
| 77 | "GPL-2.0": "GPL-2.0", |
| 78 | "GPL-2.0+": "GPL-2.0+", |
| 79 | "GPL-2.0-WITH-AUTOCONF-EXCEPTION": "GPL-2.0-with-autoconf-exception", |
| 80 | "GPL-2.0-WITH-BISON-EXCEPTION": "GPL-2.0-with-bison-exception", |
| 81 | "GPL-2.0-WITH-CLASSPATH-EXCEPTION": "GPL-2.0-with-classpath-exception", |
| 82 | "GPL-2.0-WITH-FONT-EXCEPTION": "GPL-2.0-with-font-exception", |
| 83 | "GPL-2.0-WITH-GCC-EXCEPTION": "GPL-2.0-with-GCC-exception", |
| 84 | "GPL-3.0": "GPL-3.0", |
| 85 | "GPL-3.0+": "GPL-3.0+", |
| 86 | "GPL-3.0-WITH-AUTOCONF-EXCEPTION": "GPL-3.0-with-autoconf-exception", |
| 87 | "GPL-3.0-WITH-GCC-EXCEPTION": "GPL-3.0-with-GCC-exception", |
| 88 | "LGPL-2.0": "LGPL-2.0", |
| 89 | "LGPL-2.0+": "LGPL-2.0+", |
| 90 | "LGPL-2.1": "LGPL-2.1", |
| 91 | "LGPL-2.1+": "LGPL-2.1+", |
| 92 | "LGPL-3.0": "LGPL-3.0", |
| 93 | "LGPL-3.0+": "LGPL-3.0+", |
| 94 | "NET-SNMP": "Net-SNMP", |
| 95 | "NUNIT": "Nunit", |
| 96 | "STANDARDML-NJ": "StandardML-NJ", |
| 97 | "WXWINDOWS": "wxWindows", |
| 98 | } |