Commit dd3a4931 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9a41b3bd
......@@ -544,9 +544,10 @@ def spdx_license_canon(license_name):
# XXX split on ';' ',' 'and' 'or'
# XXX split as if list ['MIT', 'BSD'] (pystemmer)
lic = license_name.strip()
lic = removeprefix("deprecaed_", lic)
lic = removeprefix(lic, "deprecated_")
lic = removesuffix(lic, "-only")
if lic.endswith('-or-later'):
lic = removesufix(lid, '-or-later')
lic = removesuffix(lic, '-or-later')
lic += '+'
spdx = _licrevdb.get(lic)
if spdx is None:
......@@ -607,10 +608,11 @@ def license_of(url):
licv = licv.decode('utf-8')
licv = licv.splitlines()
assert licv[0] == xpath, (licv[0], xpath)
licv = licv[1:] # first best match
licv = licv[1:]
#print(licv, file=sys.stderr)
lic = licv[0]
if licv == "no license file was found":
lic = licv[0] # first best match
lic = lic.strip()
if lic == "no license file was found":
lic = ''
else:
lic = lic.split(None, 1)[1]
......
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