Add AGPL-3.0-or-later and automatically translate "+" suffix into "-or-later"
This way we don't need to add all the deprecated variants with "+" suffix. Fixes #84.
This commit is contained in:
parent
e1cfff3216
commit
04f63e0f20
2 changed files with 11 additions and 7 deletions
|
@ -35,18 +35,24 @@ def translate_license_fedora(license):
|
||||||
elif tag.upper() == 'AND':
|
elif tag.upper() == 'AND':
|
||||||
final.append('and')
|
final.append('and')
|
||||||
else:
|
else:
|
||||||
mapped = spdx_to_fedora_map().get(tag, None)
|
if tag.endswith('+'):
|
||||||
|
key = tag[:-1] + '-or-later'
|
||||||
|
fulltag = f'{tag} ({key})'
|
||||||
|
else:
|
||||||
|
key = fulltag = tag
|
||||||
|
|
||||||
|
mapped = spdx_to_fedora_map().get(key, None)
|
||||||
if mapped is None:
|
if mapped is None:
|
||||||
comments += f'# FIXME: Upstream uses unknown SPDX tag {tag}!'
|
comments += f'# FIXME: Upstream uses unknown SPDX tag {fulltag}!'
|
||||||
final.append(tag)
|
final.append(tag)
|
||||||
elif mapped == '':
|
elif mapped == '':
|
||||||
comments += f"# FIXME: Upstream SPDX tag {tag} not listed in Fedora's good licenses list.\n"
|
comments += f"# FIXME: Upstream SPDX tag {fulltag} not listed in Fedora's good licenses list.\n"
|
||||||
comments += "# FIXME: This package might not be allowed in Fedora!\n"
|
comments += "# FIXME: This package might not be allowed in Fedora!\n"
|
||||||
final.append(tag)
|
final.append(tag)
|
||||||
else:
|
else:
|
||||||
final.append(mapped)
|
final.append(mapped)
|
||||||
if mapped != tag:
|
if mapped != tag:
|
||||||
print(f'Upstream license tag {tag} translated to {mapped}',
|
print(f'Upstream license tag {fulltag} translated to {mapped}',
|
||||||
file=_sys.stderr)
|
file=_sys.stderr)
|
||||||
return (' '.join(final), comments or None)
|
return (' '.join(final), comments or None)
|
||||||
|
|
||||||
|
|
|
@ -138,17 +138,15 @@ Giftware License,Giftware,Giftware,,,
|
||||||
GL2PS License,GL2PS,GL2PS,,,
|
GL2PS License,GL2PS,GL2PS,,,
|
||||||
Glulxe License,Glulxe,Glulxe,,,
|
Glulxe License,Glulxe,Glulxe,,,
|
||||||
GNU Affero General Public License v3.0,AGPL-3.0,AGPLv3,Affero General Public License 3.0,,
|
GNU Affero General Public License v3.0,AGPL-3.0,AGPLv3,Affero General Public License 3.0,,
|
||||||
|
GNU Affero General Public License v3.0 or later,AGPL-3.0-or-later,AGPLv3+,Affero General Public License 3.0 or later,,
|
||||||
GNU Free Documentation License v1.1,GFDL-1.1,,,This specific version not on Fedora list,
|
GNU Free Documentation License v1.1,GFDL-1.1,,,This specific version not on Fedora list,
|
||||||
GNU Free Documentation License v1.2,GFDL-1.2,,,This specific version not on Fedora list,
|
GNU Free Documentation License v1.2,GFDL-1.2,,,This specific version not on Fedora list,
|
||||||
GNU Free Documentation License v1.3,GFDL-1.3,GFDL,,,
|
GNU Free Documentation License v1.3,GFDL-1.3,GFDL,,,
|
||||||
GNU General Public License v1.0 only,GPL-1.0,GPLv1,,,
|
GNU General Public License v1.0 only,GPL-1.0,GPLv1,,,
|
||||||
GNU General Public License v1.0 or later,GPL-1.0+,GPLv1+,,,
|
|
||||||
GNU General Public License v1.0 or later,GPL-1.0-or-later,GPLv1+,,,
|
GNU General Public License v1.0 or later,GPL-1.0-or-later,GPLv1+,,,
|
||||||
GNU General Public License v2.0 only,GPL-2.0,GPLv2,,,
|
GNU General Public License v2.0 only,GPL-2.0,GPLv2,,,
|
||||||
GNU General Public License v2.0 or later,GPL-2.0+,GPLv2+,,,
|
|
||||||
GNU General Public License v2.0 or later,GPL-2.0-or-later,GPLv2+,,,
|
GNU General Public License v2.0 or later,GPL-2.0-or-later,GPLv2+,,,
|
||||||
GNU General Public License v3.0 only,GPL-3.0,GPLv3,,,
|
GNU General Public License v3.0 only,GPL-3.0,GPLv3,,,
|
||||||
GNU General Public License v3.0 or later,GPL-3.0+,GPLv3+,,,
|
|
||||||
GNU General Public License v3.0 or later,GPL-3.0-or-later,GPLv3+,,,
|
GNU General Public License v3.0 or later,GPL-3.0-or-later,GPLv3+,,,
|
||||||
GNU Lesser General Public License v2.1 only,LGPL-2.1,LGPLv2,,,
|
GNU Lesser General Public License v2.1 only,LGPL-2.1,LGPLv2,,,
|
||||||
GNU Lesser General Public License v3.0 only,LGPL-3.0,LGPLv3,,,
|
GNU Lesser General Public License v3.0 only,LGPL-3.0,LGPLv3,,,
|
||||||
|
|
|
Loading…
Reference in a new issue