Commit 41c92b9f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9edf3677
......@@ -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:
......
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