gentoo / cargo-ebuild

[MIRROR] cargo extension that can generate ebuilds using the in-tree eclasses
https://gitweb.gentoo.org/proj/cargo-ebuild.git
Apache License 2.0
33 stars 10 forks source link

Initial support for license mapping #8

Closed leonardohn closed 3 years ago

leonardohn commented 3 years ago

This adds initial support for SPDX to gentoo license mapping (as in #1). Please note that the mapping may be incorrect or missing licenses that are already in gentoo repository.

gyakovlev commented 3 years ago

Hi,

thanks, this is awesome. I initially thought that mapping matching licenses is not really needed. is there a particular reason you've explicitly mapped all?

leonardohn commented 3 years ago

Unfortunately repoman complains if you don't use the repository license names. It could be an external mapping file, as you suggested in the issue, but as we still don't have that, I just took the SPDX licenses and fuzzy matched against the existing ones in gentoo repository. Do you have any idea on how we could improve this?

gyakovlev commented 3 years ago

what I mean is: "EPL-2.0" => "EPL-2.0", for example is redundant and a no-op, as several others. so maybe shorten the list to known non-matching license files only? and otherwise take the name verbatim.

leonardohn commented 3 years ago

Oh, I did this way to differentiate existing licenses with the same name from the ones that are not present in the repository, so the user gets a warning for each one that is not available yet. It can also be replaced by an Option<&'static str> to preserve this behavior, but that would only save a few bytes. Do you think it is better to stick with that or simply ignore if they are not available?

gyakovlev commented 3 years ago

merged, added Apache-2.0-with-LLVM-exceptions in b4314edc5bb672f5e94dcbc996f443e98fdb4dba as well

thanks!