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

[SCM] Debian package checker branch, master, updated. 2.2.13-63-gc78393a



The following commit has been merged in the master branch:
commit fba6bae9de94a3f8b5bffd4e16976fbb3f9b25cb
Author: Russ Allbery <rra@debian.org>
Date:   Sat Aug 15 21:59:42 2009 -0700

    Avoid some duplicated word false positives
    
    * checks/description:
      + [RA] Avoid duplicated word false positives from words that contain
        punctuation.  Thanks, Nelson A. de Oliveira.  (Closes: #540348)

diff --git a/checks/description b/checks/description
index 22d27f1..bc71c26 100644
--- a/checks/description
+++ b/checks/description
@@ -122,11 +122,14 @@ foreach (split /\n/, $description) {
 	tag "description-contains-dh-make-perl-template";
     }
 
-    my $wo_quotes = $_;
-    $wo_quotes =~ s,(\"|\')(.*?)(\1),,;
-    while ($wo_quotes =~ m,(?:\W|^)((\w+)(\s+(\2))+)(?:\W|\z),i) {
+    # Check for duplicated words.  We want to catch "this this." but not
+    # "ITU-T T.81", so compare non-whitespace sequences rather than word
+    # characters but allow punctuation at the end.
+    my $stripped = $_;
+    $stripped =~ s,(\"|\')(.*?)(\1),,g;
+    while ($stripped =~ m%(?:\s|^)((\S+)(\s+(\2))+)(?:[\).,?!:;\s]|\z)%i) {
 	my $words = $1;
-	$wo_quotes =~ s/\Q$words//;
+	$stripped =~ s/\Q$words//;
         tag "description-contains-duplicated-word", "$words";
     }
 
diff --git a/debian/changelog b/debian/changelog
index 6cc352e..d9e73d1 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,8 @@ lintian (2.2.14) UNRELEASED; urgency=low
   * checks/description:
     + [RA] Decode descriptions from UTF-8 before checking length.  Thanks,
       Charles Plessy.  (Closes: #537207)
+    + [RA] Avoid duplicated word false positives from words that contain
+      punctuation.  Thanks, Nelson A. de Oliveira.  (Closes: #540348)
   * checks/fields{,.desc}:
     + [FL] packages named lib*-camlp4-dev should be in section ocaml
     + [RA] Move debian/rules parsing to check build dependencies to
diff --git a/t/tests/description-general/debian/debian/control.in b/t/tests/description-general/debian/debian/control.in
index 309c147..1837a69 100644
--- a/t/tests/description-general/debian/debian/control.in
+++ b/t/tests/description-general/debian/debian/control.in
@@ -85,3 +85,13 @@ Description: test package with UTF-8 description (“héh锓héh锓hé
  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.
+
+Package: {$srcpkg}-not-dup
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: test package with duplicated words that aren't
+ Lossless JPEG is defined in ITU-T T.81, ISO/IEC IS 10918-1.
+ .
+ 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.

-- 
Debian package checker


Reply to: