Verified Commit 945ea81d authored by Mattia Rizzolo's avatar Mattia Rizzolo
Browse files

rfs plugin: rename "Upstream author" with "Upstream Contact"

Fixes: #148


Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 4c8e44f3
Pipeline #424476 failed with stage
in 12 minutes and 29 seconds
......@@ -5,13 +5,13 @@ Dear mentors,
I am looking for a sponsor for my package "{{ upload.package.name|default:"hello" }}":
* Package name : {{ upload.package.name|default:"hello" }}
Version : {{ upload.version|default:"3.1-4" }}
Upstream Author : {{ info.author|default:"[fill in name and email of upstream]" }}
* URL : {{ upload.sourcepackage_set.get.homepage|default:"[fill in URL of upstream's web site]" }}
* License : {{ info.licenses|default:"[fill in]" }}
* Vcs : {{ upload.sourcepackage_set.get.get_vcs_browser|default:"[fill in URL of packaging vcs]" }}
Section : {{ upload.sourcepackage_set.get.section.name|default:"[fill in]" }}
* Package name : {{ upload.package.name|default:"hello" }}
Version : {{ upload.version|default:"3.1-4" }}
Upstream contact : {{ info.upstream_contact|default:"[fill in name and email of upstream]" }}
* URL : {{ upload.sourcepackage_set.get.homepage|default:"[fill in URL of upstream's web site]" }}
* License : {{ info.licenses|default:"[fill in]" }}
* Vcs : {{ upload.sourcepackage_set.get.get_vcs_browser|default:"[fill in URL of packaging vcs]" }}
Section : {{ upload.sourcepackage_set.get.section.name|default:"[fill in]" }}
The source builds the following binary packages:
......@@ -32,4 +32,4 @@ Alternatively, you can download the package with 'dget' using this command:
{% endif %}
{{ upload.changes|default:"[your most recent changelog entry]" }}
Regards,
\ No newline at end of file
Regards,
......@@ -38,16 +38,16 @@ class PluginRFS(BasePlugin):
This plugin collects:
- Upstream Author (from debian/copyright)
- Upstream Contact (from debian/copyright)
- License (from debian/copyright)
"""
outcome = "d/copyright is in DEP5 format"
severity = PluginSeverity.info
author = getattr(source.copyright, 'author')
upstream_contact = getattr(source.copyright, 'upstream_contact')
licenses = getattr(source.copyright, 'licenses')
if not author:
if not upstream_contact:
outcome = "Upstream-Contact missing from d/copyright"
severity = PluginSeverity.warning
......@@ -59,7 +59,7 @@ class PluginRFS(BasePlugin):
licenses = ', '.join(licenses)
data = {
'author': author,
'upstream_contact': upstream_contact,
'licenses': licenses,
}
......
......@@ -63,7 +63,7 @@ class Copyright():
def _build_copyright(self):
try:
self.licenses = self._get_licenses()
self.author = self._get_author()
self.upstream_contact = self._get_upstream_contact()
except MachineReadableFormatError as e:
raise ExceptionCopyright(e)
......@@ -83,7 +83,7 @@ class Copyright():
return licenses
def _get_author(self):
def _get_upstream_contact(self):
if self.copyright and self.copyright.header and \
self.copyright.header.upstream_contact:
return self.copyright.header.upstream_contact[0]
......
......@@ -49,7 +49,7 @@ class TestPluginRFSTemplate(TestImporterController):
PluginSeverity.info)
self.assert_plugin_data('hello', 'rfs', {
'licenses': 'MIT',
'author': 'Vincent TIME <vtime@example.org>',
'upstream_contact': 'Vincent TIME <vtime@example.org>',
})
def test_license_no_license(self):
......@@ -58,7 +58,7 @@ class TestPluginRFSTemplate(TestImporterController):
self.assert_plugin_severity('hello', 'rfs',
PluginSeverity.error)
self.assert_plugin_data('hello', 'rfs', {
'author': None, 'licenses': None
'upstream_contact': None, 'licenses': None
})
def test_license_freeform_license(self):
......@@ -67,7 +67,7 @@ class TestPluginRFSTemplate(TestImporterController):
self.assert_plugin_severity('hello', 'rfs',
PluginSeverity.error)
self.assert_plugin_data('hello', 'rfs', {
'author': None, 'licenses': None
'upstream_contact': None, 'licenses': None
})
def test_rfs_categories(self):
......@@ -83,4 +83,4 @@ class TestPluginRFSTemplate(TestImporterController):
self.import_source_package('hello-no-vcs-browser')
self.assert_importer_succeeded()
self.assert_rfs_content('hello',
'Vcs : [fill in')
'Vcs : [fill in')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment