| |
@@ -132,6 +132,8 @@
|
| |
"""
|
| |
JINJA_ENV = jinja2.Environment(undefined=jinja2.StrictUndefined,
|
| |
trim_blocks=True, lstrip_blocks=True)
|
| |
+ SPDX_TO_FEDORA = {"Apache-2.0": "ASL 2.0",
|
| |
+ "BSD-3-Clause": "BSD"}
|
| |
|
| |
def detect_editor():
|
| |
terminal = os.getenv("TERM")
|
| |
@@ -213,6 +215,12 @@
|
| |
|
| |
metadata = Metadata.from_file(toml)
|
| |
|
| |
+ def license_tokens(license):
|
| |
+ return [l.strip() for l in license.split("/")]
|
| |
+
|
| |
+ if args.target.startswith("fedora") or args.target.startswith("epel"):
|
| |
+ metadata.license = " or ".join(SPDX_TO_FEDORA.get(l, l) for l in license_tokens(metadata.license))
|
| |
+
|
| |
template = JINJA_ENV.from_string(TEMPLATE)
|
| |
|
| |
if args.patch and len(diff) > 0:
|
| |
Cargo enforces people to use SPDX licenses separated by "/" which
should be treated as OR.
However, in Fedora we have our own naming for licenses. We don't
implement yet full transliteration of all SPDX licenses, but at least
it's good start.
Reported-by: Josh Stone jistone@redhat.com
Closes: https://pagure.io/fedora-rust/rust2rpm/issue/24
Signed-off-by: Igor Gnatenko ignatenkobrain@fedoraproject.org