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
76365bce
Commit
76365bce
authored
Jul 21, 2022
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cdb086a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
nxd-bom
nxd-bom
+7
-5
No files found.
nxd-bom
View file @
76365bce
...
...
@@ -147,11 +147,12 @@ def bom_node(XXX):
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=snapshot;h=5e531d39;sf=tgz -> ('config', '5e531d39')
# https://github.com/nghttp2/nghttp2/archive/v1.40.0.tar.gz -> ('nghttp2', '1.40.0')
_gitweb_re
=
re
.
compile
(
r'/gitweb/\
?p=(?P<
name>\
w+)
\.git;a=snapshot;h=(?P<rev>\
w+)
')
_github_re = re.compile(r'
github
.
com
/
\
w
+/
(
?
P
<
name
>
\
w
+
)
/
archive
/
(
?
P
<
rev
>
\
w
+
)
')
_github_re = re.compile(r'
github
.
com
/
\
w
+/
(
?
P
<
name
>
\
w
+
)
/
archive
/
(
?
P
<
rev
>
.
+
)
$
')
def namever(url): # -> (name, ver)
for tail in ('
.
tgz
', '
.
tar
.
gz
', '
.
tbz
', '
.
tar
.
bz2
', '
.
tar
.
xz
', '
.
tar
.
lz
',
'
-
py2
.
7.
egg
', '
-
py2
.
7
-
linux
-
x86_64
.
egg
'): # FIXME -> re to cover py2/py3 x86/arm ...
url = removesuffix(url, tail)
name, ver = _namever(url)
for tail in ('
tgz
', '
tar
.
gz
', '
tbz
', '
tar
.
bz2
', '
tar
.
xz
', '
tar
.
lz
'):
ver = removesuffix(ver, '
.
'+tail)
ver = removeprefix(ver, '
v
')
return name, ver
...
...
@@ -206,17 +207,18 @@ def main():
elif what == '
node
':
bom = bom_node(arg)
# print retrieved BOM
kinds = set()
for info in bom.values():
kinds.add(info.kind)
for kind in sorted(kinds):
if kind
is not None
:
if kind
!= ''
:
print('
\
n
\
n
>>>
%
ss
:
' % kind)
for name in sorted(bom):
info = bom[name]
if info.kind == kind:
print('
%
s
\
t
%
s
' % (name, info
))
print('
%
-
20
s
\
t
%
s
' % (name, info.version
))
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