Commit dd3a4931 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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