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:
Zbigniew Jędrzejewski-Szmek 2019-06-02 15:48:45 +02:00
parent e1cfff3216
commit 04f63e0f20
2 changed files with 11 additions and 7 deletions

View file

@ -35,18 +35,24 @@ def translate_license_fedora(license):
elif tag.upper() == 'AND':
final.append('and')
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:
comments += f'# FIXME: Upstream uses unknown SPDX tag {tag}!'
comments += f'# FIXME: Upstream uses unknown SPDX tag {fulltag}!'
final.append(tag)
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"
final.append(tag)
else:
final.append(mapped)
if mapped != tag:
print(f'Upstream license tag {tag} translated to {mapped}',
print(f'Upstream license tag {fulltag} translated to {mapped}',
file=_sys.stderr)
return (' '.join(final), comments or None)

View file

@ -138,17 +138,15 @@ Giftware License,Giftware,Giftware,,,
GL2PS License,GL2PS,GL2PS,,,
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 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.2,GFDL-1.2,,,This specific version not on Fedora list,
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 or later,GPL-1.0+,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 or later,GPL-2.0+,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 or later,GPL-3.0+,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 v3.0 only,LGPL-3.0,LGPLv3,,,

1 SPDX Full name of License SPDX License Identifier Fedora Short Name Fedora Fullname (if different) Notes Other Fedora Licenses (full name) that use same short identifier and are SPDX License List equivalent (as per SPDX Matching Guidelines)
138 GNU Free Documentation License v1.3 GNU Free Documentation License v1.2 GFDL-1.3 GFDL-1.2 GFDL This specific version not on Fedora list
139 GNU General Public License v1.0 only GNU Free Documentation License v1.3 GPL-1.0 GFDL-1.3 GPLv1 GFDL
140 GNU General Public License v1.0 or later GNU General Public License v1.0 only GPL-1.0+ GPL-1.0 GPLv1+ GPLv1
141 GNU General Public License v1.0 or later GPL-1.0-or-later GPLv1+
142 GNU General Public License v1.0 or later GNU General Public License v2.0 only GPL-1.0-or-later GPL-2.0 GPLv1+ GPLv2
143 GNU General Public License v2.0 only GNU General Public License v2.0 or later GPL-2.0 GPL-2.0-or-later GPLv2 GPLv2+
144 GNU General Public License v2.0 or later GNU General Public License v3.0 only GPL-2.0+ GPL-3.0 GPLv2+ GPLv3
145 GNU General Public License v2.0 or later GNU General Public License v3.0 or later GPL-2.0-or-later GPL-3.0-or-later GPLv2+ GPLv3+
GNU General Public License v3.0 only GPL-3.0 GPLv3
146 GNU General Public License v3.0 or later GNU Lesser General Public License v2.1 only GPL-3.0+ LGPL-2.1 GPLv3+ LGPLv2
147 GNU General Public License v3.0 or later GNU Lesser General Public License v3.0 only GPL-3.0-or-later LGPL-3.0 GPLv3+ LGPLv3
GNU Lesser General Public License v2.1 only LGPL-2.1 LGPLv2
148 GNU Lesser General Public License v3.0 only GNU Library General Public License v2 only LGPL-3.0 LGPL-2.0 LGPLv3 LGPLv2
149 GNU Library General Public License v2 only gnuplot License LGPL-2.0 gnuplot LGPLv2 gnuplot
gnuplot License gnuplot gnuplot
150 gSOAP Public License v1.3b gSOAP-1.3b not on Fedora list
151 Haskell Language Report License HaskellReport HaskellReport
152 Historic Permission Notice and Disclaimer HPND MIT