metadata: parse description

New cargo exposes description, so we can even generate summary out
of it.

We will need to do some pre-processing in future, but good enough for
the beginning.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-02-14 18:43:51 +01:00
parent 2fbb50e1dc
commit 1282937913
2 changed files with 3 additions and 1 deletions

View file

@ -71,7 +71,7 @@ TEMPLATE = """# Generated by rust2rpm
Name: {{ name }} Name: {{ name }}
Version: {{ md.version }} Version: {{ md.version }}
Release: 1%{?dist} Release: 1%{?dist}
Summary: # FIXME Summary: {{ md.description|default("# FIXME") }}
License: {{ md.license|default("# FIXME") }} License: {{ md.license|default("# FIXME") }}
URL: https://crates.io/crates/{{ md.name }} URL: https://crates.io/crates/{{ md.name }}

View file

@ -39,6 +39,7 @@ class Metadata(object):
self.name = None self.name = None
self.license = None self.license = None
self.license_file = None self.license_file = None
self.description = None
self._version = None self._version = None
self._targets = [] self._targets = []
self._provides = [] self._provides = []
@ -57,6 +58,7 @@ class Metadata(object):
self.name = md["name"] self.name = md["name"]
self.license = md["license"] self.license = md["license"]
self.license_file = md["license_file"] self.license_file = md["license_file"]
self.description = md.get("description")
self._version = semver.SpecItem("={}".format(md["version"])) self._version = semver.SpecItem("={}".format(md["version"]))
# Targets # Targets