[lintian] 01/01: Avoid false positives in debian-control-has-empty-field when the field is wrapped onto a new line. Thanks to Mattia Rizzolo for the report. (Closes: #879977)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit deaee84ee7a022ffacf4069b56c0338cd98c2f31
Author: Chris Lamb <lamby@debian.org>
Date: Fri Oct 27 22:07:58 2017 +0100
Avoid false positives in debian-control-has-empty-field when the field is wrapped onto a new line. Thanks to Mattia Rizzolo for the report. (Closes: #879977)
---
checks/control-file.pm | 12 +++++++++---
debian/changelog | 5 +++++
t/tests/control-has-empty-field/debian/debian/control.in | 3 +++
t/tests/control-has-empty-field/tags | 3 ++-
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/checks/control-file.pm b/checks/control-file.pm
index c60762e..9c8fe4e 100644
--- a/checks/control-file.pm
+++ b/checks/control-file.pm
@@ -101,9 +101,6 @@ sub run {
if ($field eq 'xc-package-type') {
tag 'xc-package-type-in-debian-control', "line $.";
}
- if (/^(\S+):$/) {
- tag 'debian-control-has-empty-field', "$1 (line $.)";
- }
unless (/^\S+: \S/ || /^\S+:$/) {
tag 'debian-control-has-unusual-field-spacing', "line $.";
}
@@ -128,6 +125,12 @@ sub run {
return;
}
+ foreach my $field (keys %{$info->source_field()}) {
+ tag 'debian-control-has-empty-field',
+ "field \"$field\" in source paragraph",
+ if $info->source_field($field) eq '';
+ }
+
my @package_names = $info->binaries;
foreach my $bin (@package_names) {
@@ -142,6 +145,9 @@ sub run {
"field \"$field\" in package $bin"
if ( $info->source_field($field)
&& $bfields->{$field} eq $info->source_field($field));
+ tag 'debian-control-has-empty-field',
+ "field \"$field\" in package $bin",
+ if $bfields->{$field} eq '';
}
if ($bin =~ /[-]dbgsym$/) {
tag 'debian-control-has-dbgsym-package', $bin;
diff --git a/debian/changelog b/debian/changelog
index 9542dd6..7addfcb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,11 @@ lintian (2.5.57) UNRELEASED; urgency=medium
XXX: generate tag summary
+ * checks/control-file.pm:
+ + [CL] Avoid false positives in debian-control-has-empty-field when the
+ field is wrapped onto a new line. Thanks to Mattia Rizzolo for the
+ report. (Closes: #879977)
+
-- Chris Lamb <lamby@debian.org> Fri, 27 Oct 2017 20:00:29 +0100
lintian (2.5.56) unstable; urgency=medium
diff --git a/t/tests/control-has-empty-field/debian/debian/control.in b/t/tests/control-has-empty-field/debian/debian/control.in
index f56f600..3bcf6eb 100644
--- a/t/tests/control-has-empty-field/debian/debian/control.in
+++ b/t/tests/control-has-empty-field/debian/debian/control.in
@@ -2,10 +2,13 @@ Source: {$source}
Priority: optional
Section: {$section}
Maintainer: {$author}
+Uploaders:
+ Wrapped Onto New Line <test@example.com>
Standards-Version: {$standards_version}
Build-Depends: {$build_depends}
Rules-Requires-Root: binary-targets
Homepage: https://lintian.debian.org/
+Vcs-Browser:
Package: {$source}
Architecture: {$architecture}
diff --git a/t/tests/control-has-empty-field/tags b/t/tests/control-has-empty-field/tags
index 3e3277d..6b0c9f3 100644
--- a/t/tests/control-has-empty-field/tags
+++ b/t/tests/control-has-empty-field/tags
@@ -1 +1,2 @@
-P: control-has-empty-field source: debian-control-has-empty-field Suggests (line 13)
+P: control-has-empty-field source: debian-control-has-empty-field field "suggests" in package control-has-empty-field
+P: control-has-empty-field source: debian-control-has-empty-field field "vcs-browser" in source paragraph
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: