[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.11-129-g62dad88



The following commit has been merged in the master branch:
commit 62dad887e4de9652ab65a79b3e01107a340f7e5b
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Jan 29 12:18:30 2013 +0100

    c/source-copyright: Add line numbers to the "field typo" tag
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/source-copyright b/checks/source-copyright
index 6bb6ba9..e3b508e 100644
--- a/checks/source-copyright
+++ b/checks/source-copyright
@@ -169,9 +169,9 @@ if (@dep5) {
     my $i = 0;
     for my $para (@dep5) {
         $i++;
-        my $license = get_field ($para, 'license');
-        my $files = get_field ($para, 'files');
-        my $copyright = get_field ($para, 'copyright');
+        my $license = get_field ($para, 'license', $lines[$i]);
+        my $files = get_field ($para, 'files', $lines[$i]);
+        my $copyright = get_field ($para, 'copyright', $lines[$i]);
 
         if (not defined $files and defined $license and defined $copyright) {
             tag 'ambiguous-paragraph-in-dep5-copyright', "paragraph at line $lines[$i]";
@@ -236,12 +236,12 @@ sub split_licenses {
 }
 
 sub get_field {
-    my ($para, $field) = @_;
+    my ($para, $field, $line) = @_;
     return $para->{$field} if exists $para->{$field};
     # Fall back to a "likely misspelling" of the field.
     foreach my $f (sort keys %$para) {
         if (distance ($field, $f) < 3) {
-            tag 'field-name-typo-in-dep5-copyright', $f, '->', $field;
+            tag 'field-name-typo-in-dep5-copyright', $f, '->', $field, "(paragraph at line $line)";
             return $para->{$f};
         }
     }
diff --git a/debian/changelog b/debian/changelog
index b13a6dd..11f4b3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -75,6 +75,7 @@ lintian (2.5.12) UNRELEASED; urgency=low
     + [JW,NT] Add a separate tag for ambiguous DEP-5 paragraphs,
       where Lintian cannot reliably figure out what is intended.
       Thanks to Julian Taylor for the report.  (Closes: #652380)
+    + [NT] Add paragraph line number to the "field typo" tag.
   * checks/symlinks{,.desc}:
     + [NT] Warn about broken symlinks that contains a literal "*"
       in their target.  This is usually a sign that a wildcard did
diff --git a/t/tests/source-copyright-typo-field/tags b/t/tests/source-copyright-typo-field/tags
index 6e55e63..14dae3a 100644
--- a/t/tests/source-copyright-typo-field/tags
+++ b/t/tests/source-copyright-typo-field/tags
@@ -1,3 +1,3 @@
-W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright copyrigth -> copyright
-W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright file -> files
-W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright licens -> license
+W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright copyrigth -> copyright (paragraph at line 6)
+W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright file -> files (paragraph at line 6)
+W: source-copyright-typo-field source: field-name-typo-in-dep5-copyright licens -> license (paragraph at line 6)

-- 
Debian package checker


Reply to: