Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nxd-bom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
nxd-bom
Commits
a3a05334
Commit
a3a05334
authored
Jun 12, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
38123d51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
nxdbom/__init__.py
nxdbom/__init__.py
+15
-7
No files found.
nxdbom/__init__.py
View file @
a3a05334
...
...
@@ -497,38 +497,46 @@ def removesuffix(s, suffix):
# it is an error is license_name cannot be recognized.
_licdb
=
{
# spdx -> variants
'Apache-2.0'
:
'Apache License 2.0 | Apache License, Version 2.0 | http://www.apache.org/licenses/LICENSE-2.0'
,
'BSD-2-Clause'
:
'2-Clause BSD'
,
'BSD-3-Clause'
:
'3-clause BSD License | BSD 3-Clause License | BSD (3-clause)'
,
'CNRI-Python'
:
'Python License (CNRI Python License)'
,
'EPL-1.0'
:
'Eclipse Public License 1.0'
,
'HPND'
:
''
,
'ISC'
:
'ISC license'
,
'LGPL-2.1'
:
''
,
'GPL-2.0+'
:
'GPL 2+'
,
'GPL-3.0+'
:
'GNU GPLv3+'
,
'GPL-3.0'
:
'GPLv3 | GNU General Public License Version 3'
,
'GPL-3.0'
:
'GPLv3 | G
PL3 | G
NU General Public License Version 3'
,
'MIT'
:
'MIT License'
,
'ZPL-2.1'
:
''
,
'MPL-2.0'
:
''
,
'ZPL-2.1'
:
'ZPL 2.1 (http://www.zope.org/Resources/License/ZPL-2.1)'
,
'GPL-3.0+-with-NXD-exception'
:
'GPLv3+ with wide exception for FOSS | GPLv3+ with wide exception for Open-Source'
,
# XXX no versions
'BSD'
:
'OSI Approved :: BSD License'
,
'BSD'
:
'
BSD License |
OSI Approved :: BSD License'
,
'GPL'
:
''
,
'LGPL'
:
''
,
'PSF'
:
'Python Software Foundation License'
,
'PSF'
:
'P
SF license | P
ython Software Foundation License'
,
}
_licrevdb
=
{}
# variant -> spdx
for
lic
,
variants
in
_licdb
.
items
():
vv
=
[]
if
variants
:
vv
=
variants
.
split
(
'|'
)
vv
.
append
(
lic
)
# e.g. MIT -> MIT
vv
.
append
(
lic
)
# MIT -> MIT
vv
.
append
(
'"%s"'
%
lic
)
# "MIT" -> MIT
licsp
=
lic
.
replace
(
'-'
,
' '
)
if
licsp
!=
lic
:
vv
.
append
(
licsp
)
#
e.g.
ZPL 2.1 -> ZPL-2.1
vv
.
append
(
licsp
)
# ZPL 2.1 -> ZPL-2.1
for
v
in
vv
:
v
=
v
.
strip
()
assert
v
not
in
_licrevdb
,
repr
(
v
)
_licrevdb
[
v
]
=
lic
def
spdx_license_canon
(
license_name
):
# XXX split on ; and 'and' ?
# XXX split on ';' ',' 'and' 'or'
# XXX split as if list ['MIT', 'BSD'] (pystemmer)
license_name
=
license_name
.
strip
()
spdx
=
_licrevdb
.
get
(
license_name
)
if
spdx
is
None
:
return
license_name
# XXX temp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment