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

[SCM] Debian package checker branch, master, updated. 2.4.3-206-g4419f75



The following commit has been merged in the master branch:
commit 4419f751a2b93556f94ceeb0121f7aca885acd0c
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jan 29 23:01:36 2011 +0100

    Fixed false positive "description-contains-duplicated-word"
    
    * checks/description:
        + [NT] Fixed false positive description-contains-duplicated-word
          caused by Lintian ignoring quoted words.  Thanks to Gregor
          Herrmann for report.  (Closes: #590723)

diff --git a/checks/description b/checks/description
index cebd96f..fca8004 100644
--- a/checks/description
+++ b/checks/description
@@ -133,8 +133,12 @@ foreach (split /\n/, $description) {
     #
     # We don't want to think ", ," or "a, a" is a duplicated word, so require
     # that a word start and end with a word character.
+    #
+    # We replace text that is quoted with ' "" '.  The assumption is that
+    # quoted words are "okay" and blindly removing them causes false
+    # positives with text like "'a' or 'b' or 'c'".
     my $stripped = $_;
-    $stripped =~ s,(["'])(.*?)(\1),,g;
+    $stripped =~ s,(["'])(.*?)(\1), "" ,g;
     while ($stripped =~
 	   m%(?:\s|^)((\w(?:\S*\w)?)(\s+(\2))+)(?:[\).,?!:;\s]|\z)%i) {
 	my $words = $1;
diff --git a/debian/changelog b/debian/changelog
index 4c1ad3a..028461f 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -58,6 +58,9 @@ lintian (2.5.0) UNRELEASED; urgency=low
   * checks/description{,.desc}:
     + [NT] Add a check for synopsis starting with articles.  Thanks to
       Nelson A. de Oliveira for the patch.  (Closes: #603053)
+    + [NT] Fixed false positive description-contains-duplicated-word
+      caused by Lintian ignoring quoted words.  Thanks to Gregor
+      Herrmann for report.  (Closes: #590723)
   * checks/fields{,.desc}:
     + [NT] Added check for packages (build) depending on openjdk-X-doc or
       classpath-doc instead of the default-jdk-doc metapackage.
diff --git a/t/tests/description-general/debian/debian/control.in b/t/tests/description-general/debian/debian/control.in
index fff24ba..43e7b3f 100644
--- a/t/tests/description-general/debian/debian/control.in
+++ b/t/tests/description-general/debian/debian/control.in
@@ -96,6 +96,10 @@ Description: test package with duplicated words that aren't
  Contain the strings " link to ", " -> ", or ": ".
  This is train A, a particularly fast train.
  .
+ "hallo" or "evening" or "farewell" should not trigger a duplicate
+ "or or" warning.  Also "or" "or" does not trigger the warning
+ either.
+ .
  This is a test package designed to exercise some feature or tag of
  Lintian.  It is part of the Lintian test suite and may do very odd
  things.  It should not be installed like a regular package.  It may

-- 
Debian package checker


Reply to: