#86 Translate licenses with "+" suffix
Merged 4 years ago by ignatenkobrain. Opened 4 years ago by zbyszek.
fedora-rust/ zbyszek/rust2rpm translate-plus-license  into  master

file modified
+9
@@ -222,6 +222,8 @@ 

                                       formatter_class=argparse.RawTextHelpFormatter)

      parser.add_argument("--show-license-map", action="store_true",

                          help="Print license mappings and exit")

+     parser.add_argument("--translate-license", action="store_true",

+                         help="Print mapping for specified license and exit")

      parser.add_argument("--no-auto-changelog-entry", action="store_true",

                          help="Do not generate a changelog entry")

      parser.add_argument("-", "--stdout", action="store_true",
@@ -248,6 +250,13 @@ 

          licensing.dump_sdpx_to_fedora_map(sys.stdout)

          return

  

+     if args.translate_license:

+         license, comments = licensing.translate_license(args.target, args.crate)

+         if comments:

+             print(comments)

+         print(license)

+         return

+ 

      if args.crate is None:

          parser.error("required crate/path argument missing")

  

file modified
+10 -4
@@ -35,18 +35,24 @@ 

          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)

  

file modified
+1 -3
@@ -138,17 +138,15 @@ 

  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,,,

no initial comment

Pull-Request has been merged by ignatenkobrain

4 years ago