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
41c92b9f
Commit
41c92b9f
authored
Jun 12, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9edf3677
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
nxdbom/__init__.py
nxdbom/__init__.py
+20
-2
No files found.
nxdbom/__init__.py
View file @
41c92b9f
...
...
@@ -76,7 +76,8 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
ver
=
removeprefix
(
ver
,
name
+
'-'
)
# wendelin.core-2.0.alpha3-0-g6315384 -> 2.0.alpha3-0-g6315384
if
'//'
in
urlpath
:
url
=
urlpath
license
=
license_of
(
url
)
if
kind
==
''
:
license
=
license_of
(
url
)
else
:
if
kind
==
'egg'
:
# XXX not strictly correct -> better retrieve the actual URL, but buildout does not save it in installed.cfg
...
...
@@ -552,6 +553,20 @@ def spdx_license_canon(license_name):
# license_of returns license of package at url.
def
license_of
(
url
):
known
=
{
# XXX hack - no suport for .lz
'gettext-0.21.tar.lz'
:
'LGPL-2.1+ and GPL-3.0+'
,
'expat-2.2.10.tar.lz'
:
'MIT'
,
'?p=config.git;a=snapshot;h=5e531d391852a54e7fab2d8ff55625fca514b305;sf=tgz'
:
'GPL-3.0-with-autoconf-exception'
,
'https://sourceforge.net/projects/swig/files/swig/swig-3.0.12/swig-3.0.12.tar.gz/download'
:
'GPL-3.0+'
,
}
if
url
in
known
:
return
known
[
url
]
_
=
basename
(
url
)
if
_
in
known
:
return
known
[
_
]
assert
'//'
in
url
,
url
_
,
xpath
=
url
.
split
(
'//'
,
1
)
# https://tukaani.org/xz/xz-5.2.5.tar.bz2 -> tukaani.org/xz/xz-5.2.5.tar.bz
#assert '//' not in xpath, xpath XXX archive.mariadb.org//mariadb-10.3.35/source/mariadb-10.3.35.tar.gz
...
...
@@ -564,7 +579,8 @@ def license_of(url):
mkdir_p
(
'.CACHE/pkg'
)
wget
(
url
,
pkgfile
)
#shutil.unpack_archive(pkgfile, xpath)
print
(
'X %s ...'
%
pkgfile
,
file
=
sys
.
stderr
)
shutil
.
unpack_archive
(
pkgfile
,
xpath
)
# XXX
return
None
...
...
@@ -574,6 +590,8 @@ def license_of(url):
# it first tries shacache and the direct download.
_nc
=
None
def
wget
(
url
,
dstfile
):
print
(
'DL %s ...'
%
url
,
file
=
sys
.
stderr
)
# see src/zc/buildout/download.py
global
_nc
if
_nc
is
None
:
...
...
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