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
38123d51
Commit
38123d51
authored
Jun 12, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
41e34a60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
nxdbom/__init__.py
nxdbom/__init__.py
+20
-11
No files found.
nxdbom/__init__.py
View file @
38123d51
...
...
@@ -100,7 +100,7 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
if
license
is
None
:
# XXX temp
license
=
'xxx'
# XXX "UNKNOWN" not ok
#
license = spdx_license_canon(license)
license
=
spdx_license_canon
(
license
)
# XXX Eclipse Public License -> EPL (SPDX)
# 3-clause BSD -> BSD-3 ? (SPDX)
# Apache License, Version 2.0
...
...
@@ -496,16 +496,23 @@ 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'
,
'EPL-1.0'
:
'Eclipse Public License 1.0'
,
'GPL-2.0+'
:
'GPL 2+'
,
'GPL-3.0+'
:
'GNU GPLv3+'
,
'GPL-3.0'
:
'GPLv3 | GNU General Public License Version 3'
,
'MIT'
:
''
,
'PSF'
:
'Python Software Foundation License'
,
# XXX no ver
'ZPL-2.1'
:
''
,
'GPL-3.0+-with-NXD-exception'
:
'GPLv3+ with wide exception for FOSS'
,
'Apache-2.0'
:
'Apache License 2.0 | Apache License, Version 2.0 | http://www.apache.org/licenses/LICENSE-2.0'
,
'CNRI-Python'
:
'Python License (CNRI Python License)'
,
'EPL-1.0'
:
'Eclipse Public License 1.0'
,
'HPND'
:
''
,
'GPL-2.0+'
:
'GPL 2+'
,
'GPL-3.0+'
:
'GNU GPLv3+'
,
'GPL-3.0'
:
'GPLv3 | GNU General Public License Version 3'
,
'MIT'
:
'MIT 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'
,
'GPL'
:
''
,
'LGPL'
:
''
,
'PSF'
:
'Python Software Foundation License'
,
}
_licrevdb
=
{}
# variant -> spdx
for
lic
,
variants
in
_licdb
.
items
():
...
...
@@ -521,8 +528,10 @@ for lic, variants in _licdb.items():
assert
v
not
in
_licrevdb
,
repr
(
v
)
_licrevdb
[
v
]
=
lic
def
spdx_license_canon
(
license_name
):
# XXX split on ; and 'and' ?
spdx
=
_licrevdb
.
get
(
license_name
)
if
spdx
is
None
:
return
license_name
# XXX temp
raise
ValueError
(
'unknown license %r'
%
license_name
)
return
spdx
...
...
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