Commit 76365bce authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cdb086a5
......@@ -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('%-20s\t%s' % (name, info.version))
if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment