#53 Convert Cargo license metadata expression logic to equivalent SPDX logic
Closed 5 years ago by ignatenkobrain. Opened 5 years ago by ngompa.
fedora-rust/ ngompa/rust2rpm license-slash-to-or  into  master

file modified
+2
@@ -143,6 +143,8 @@ 

                                               fromfiledate=mtime_before, tofiledate=mtime_after))

  

          metadata = Metadata.from_file(toml)

+         if "/" in metadata.license:

+             metadata.license = " OR ".join([l.strip() for l in metadata.license.split("/")])

  

      template = JINJA_ENV.get_template("main.spec")

  

Cargo metadata historically followed SPDX expression logic with the exception of using a forward slash (/) for OR. However, distributions that validate licensing with SPDX expressions expect the correct form. In addition, Cargo has deprecated the legacy syntax for proper SPDX expressions.

This makes sure we can deal with crates using the legacy expression format correctly on distributions like openSUSE that validate SPDX expressions in the license tag in packages.

Signed-off-by: Neal Gompa ngompa13@gmail.com

rebased onto 7ee59a8

5 years ago

Hmm, there's also #25, which uses lowercase "or" and also maps a few license names. What do you think of that one?

Pull-Request has been closed by ignatenkobrain

5 years ago

@ignatenkobrain SPDX changed to upper-case OR, and #25 does conversion to Fedora tags which I'm specifically avoiding.

Metadata