tag 409124 patch
thanks
Hi,
A lot of different tools parse debian/control. That's why I think such a
sanitize check is important.
Cheers,
Gonéri
---
checks/control-file | 11 ++++++++++-
checks/control-file.desc | 6 ++++++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/checks/control-file b/checks/control-file
index a46e716..962d7b3 100644
--- a/checks/control-file
+++ b/checks/control-file
@@ -47,10 +47,19 @@ if ($line) {
tag "debian-control-file-uses-obsolete-national-encoding", "at line $line"
}
-# Check that each field is only used once:
my $seen_fields = {};
open (CONTROL, '<', "debfiles/control")
or fail "Couldn't read debfiles/control: $!";
+
+# Looks for trailing whitespace:
+{
+ local $/ = undef;
+ my $lines = <CONTROL>;
+ if ($lines =~ /(^|\n)([-\w]+):[^\n]*?[\ \t]+\n/) {
+ tag "debian-control-file-has-trailing-whitespace", "near section $2"
+ }
+}
+# Check that each field is only used once:
while (<CONTROL>) {
s/\s*\n$//;
next if /^\#/;
diff --git a/checks/control-file.desc b/checks/control-file.desc
index 2254752..c2b4be5 100644
--- a/checks/control-file.desc
+++ b/checks/control-file.desc
@@ -138,3 +138,9 @@ Severity: normal
Certainty: certain
Info: The given package declares a dependency on libc directly instead
of using ${shlibs:Depends} in its <tt>debian/control</tt> stanza.
+
+Tag: debian-control-file-has-trailing-whitespace
+Severity: normal
+Certainty: certain
+Info: A useless space is present at the end of a line in your
+ <tt>debian/control</tt>.
--
1.6.1.3
Attachment:
signature.asc
Description: Digital signature