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
edea6dcd
Commit
edea6dcd
authored
Jul 21, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
76365bce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
nxd-bom
nxd-bom
+16
-5
No files found.
nxd-bom
View file @
edea6dcd
...
...
@@ -36,7 +36,8 @@ from collections import namedtuple
PkgInfo
=
namedtuple
(
'PkgInfo'
,
[
'name'
,
'version'
,
'kind'
])
'kind'
,
'url'
])
...
...
@@ -44,8 +45,18 @@ PkgInfo = namedtuple('PkgInfo', [
def
bom_software
(
installed_software_path
):
# -> {} name -> PkgInfo
bom
=
{}
def
addbom
(
urlpath
,
kind
):
name
,
ver
=
namever
(
urlpath
)
# XXX strip egg and py2.7-linux-x86_64
info
=
PkgInfo
(
name
,
ver
,
kind
)
name
,
ver
=
namever
(
urlpath
)
if
'//'
in
urlpath
:
url
=
urlpath
else
:
if
kind
==
'egg'
:
# XXX not strictly correct -> better retrieve the actual URL, but buildout does not save it in installed.cfg
url
=
'https://pypi.org/project/%s/%s/'
%
(
name
,
ver
)
else
:
raise
NotImplementedError
(
'TODO url for kind %s'
%
kind
)
info
=
PkgInfo
(
name
,
ver
,
kind
,
url
)
if
name
in
bom
:
assert
bom
[
name
]
==
info
,
(
bom
[
name
],
info
)
else
:
...
...
@@ -207,7 +218,7 @@ def main():
elif what == '
node
':
bom = bom_node(arg)
# print retrieved BOM
# print retrieved BOM
grouped by kind
kinds = set()
for info in bom.values():
kinds.add(info.kind)
...
...
@@ -218,7 +229,7 @@ def main():
for name in sorted(bom):
info = bom[name]
if info.kind == kind:
print('
%-
20
s
\
t
%
s
' % (name, info.version
))
print('
%-
20
s
\
t
%
s
\
t
%
s
' % (name, info.version, info.url
))
if __name__ == '
__main__
':
...
...
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