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

[SCM] Debian package checker branch, master, updated. 2.5.12-94-gf9f1b3e



The following commit has been merged in the master branch:
commit 2d39df477c5d8b3895b328637f7f6b60ddf0baf2
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date:   Sun May 19 12:46:32 2013 +0200

    Fix false positive for detection of gfdl license problem
    
    If text is embeded in C string we have false positive.
    Fix it.
    
    [nthykier: rewrite the "$s" regex with comments]
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/checks/cruft b/checks/cruft
index da0d39c..6391e96 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,16 @@ sub find_cruft {
                          A \s+ copy \s+ of \s+ the \s+ license \s+ is \s+ included/xis) {
                     if (!exists $licenseproblemhash{'gfdl-invariants'}) {
                         # local space
-                        my $s = '(?:\s|\@c|[%\*]|\n[-\+!<>]|\n\.\\\"|<br\s*/?>)';
+                        my $s = qr{(?:
+                          \s          |  # regular space(s)
+                          \@c         |  # Tex info comment
+                          [%\*\"]     |  # String, C-style comment/javadoc indent and quotes for strings
+                          \"\s*,      |  # String array (e.g. "line1",\n"line2")
+                          ,\s*\"      |  # String array (e.g. "line1"\n ,"line2"), seen in findutils
+                          \n[-\+!<>]  |  # diff/patch lines
+                          \n\.\\\"    |  # man comments
+                          <br\s*/?>      # (X)HTML line breaks
+                        )}xiso;
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/findutilsok.c b/t/tests/cruft-gfdl-invariants/debian/src/findutilsok.c
new file mode 100644
index 0000000..23aa0af
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/findutilsok.c
@@ -0,0 +1,15 @@
+/* false positive from findutils */
+  static const char *copy_para[]=
+    {
+      "Copyright (C) 1994, 1996, 1998, 2000, 2001, 2003, 2004, 2005, 2006,"
+      ,"2007, 2009, 2010, 2011 Free Software Foundation, Inc."
+      ,""
+      ,"Permission is granted to copy, distribute and/or modify this document"
+      ,"under the terms of the GNU Free Documentation License, Version 1.3 or"
+      ,"any later version published by the Free Software Foundation; with no"
+      ,"Invariant Sections, with no Front-Cover Texts, and with no Back-Cover"
+      ,"Texts.  A copy of the license is included in the ``GNU Free"
+      ,"Documentation License'' file as part of this distribution."
+      ""
+      ,NULL
+    };

-- 
Debian package checker


Reply to: