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

Bug#708881: [lintian] Fix false positive of gfdl detection



Package: lintian
Version: 2.5.12
Severity: normal
Tags: patch

These 13 patches fixe false positive of gfdl detection.

Please review and apply.

Bastien
From 99255be67a6cb912c5520846016c3149a6dc8c44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 11:23:47 +0200
Subject: [PATCH 11/13] Add variant for dict-fold package

dict-fold use a variant syntax that is ok for gfdl with no invariants.

Allow it.
---
 checks/cruft                                                |   11 ++++++++---
 .../cruft-gfdl-invariants/debian/src/variantdictfold.txt    |    7 +++++++
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/variantdictfold.txt

diff --git a/checks/cruft b/checks/cruft
index a2c00e8..032fbe0 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -488,11 +488,16 @@ sub find_cruft {
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
-                            when(m/(?:the$s+)? no $s+ Invariant $s+ Sections?,?
-                                    $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts?,? $s+ (?:and$s+)?
-                                        (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts?/xiso) {
+                            when(m/no $s+ Invariant $s+ Sections?,?
+                                   $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts?,? $s+ (?:and$s+)?
+                                       (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts?/xiso) {
                                 # no invariant
                             }
+                            when(m/no $s+ Invariant $s+ Sections?,?
+                                      $s+ (?:no$s+)? Front-? $s+ or 
+                                      $s+ (?:no$s+)? Back-Cover $s+ Texts?/xiso) {
+                                # no invariant variant (dict-foldoc)
+                            }
                             when(m/with $s+ the $s+ Invariant $s+ Sections $s+ being
                                         $s+ (?:\@var\{|<var>)? LIST $s+ THEIR $s+TITLES (?:\}|<\/var>)? $s* ,?
                                         $s+ with $s+ the $s+ Front-Cover $s+ Texts $s+ being
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/variantdictfold.txt b/t/tests/cruft-gfdl-invariants/debian/src/variantdictfold.txt
new file mode 100644
index 0000000..f9d9615
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/variantdictfold.txt
@@ -0,0 +1,7 @@
+This is ok
+	Permission is granted to copy, distribute and/or modify this
+	document under the terms of the GNU Free Documentation
+	License, Version 1.1 or any later version published by the
+	Free Software Foundation; with no Invariant Sections, Front-
+	or Back-Cover Texts.  A copy of the license is included in the
+	section entitled "{GNU Free Documentation License}".
\ No newline at end of file
-- 
1.7.10.4

From 1c12fa735982620f9c7499b880e6151b60af8145 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sat, 18 May 2013 16:59:52 +0200
Subject: [PATCH 01/13] Be more liberal for zero is plural case for matching
 gfdl

For non native english speaker zero could be singular. Avoid to
trip lintian in the case of this grammar mistake.
---
 checks/cruft |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/checks/cruft b/checks/cruft
index b003ecb..2c0e52d 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -488,9 +488,9 @@ sub find_cruft {
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
-                            when(m/with $s+ (?:the$s+)? no $s+ Invariant $s+ Sections,?
-                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts,? $s+ and
-                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts/xiso) {
+                            when(m/with $s+ (?:the$s+)? no $s+ Invariant $s+ Sections?,?
+                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts?,? $s+ and
+                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts?/xiso) {
                                 # no invariant
                             }
                             when(m/with $s+ the $s+ Invariant $s+ Sections $s+ being
-- 
1.7.10.4

From 540ea63142b9c8ce6982597ee08410a6a93b7151 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sat, 18 May 2013 17:50:11 +0200
Subject: [PATCH 02/13] Allow patch symbols as space for gfdl detection

Allow (\n\+|\n-|\n!|\n<|\n>) aka patch marker for gdfl detection
---
 checks/cruft |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/checks/cruft b/checks/cruft
index 2c0e52d..fd34265 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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|%)';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>)';
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
-- 
1.7.10.4

From cf75490af2fe3d55d766859254d1fe61684f8e66 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sat, 18 May 2013 17:55:04 +0200
Subject: [PATCH 03/13] Allow <br/> as space for gfdl license check

<br/> is a space allow it.
---
 checks/cruft |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/checks/cruft b/checks/cruft
index fd34265..cf77f5b 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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-|\n!|\n<|\n>)';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>|<br/>)';
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
-- 
1.7.10.4

From a8c9e03281080a10169c687b9205fbf3440bddbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 09:53:04 +0200
Subject: [PATCH 05/13] Add exemple of html file with br (false positive)

---
 .../debian/src/gfdllicenseexamplesbr.html                 |   13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html

diff --git a/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html b/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html
new file mode 100644
index 0000000..fffca61
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+false positive found in license text:
+<pre>
+Copyright (C)  year  your name.
+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 the Invariant Sections being <var>list their titles</var>, with
+the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
+being <var>list</var>.
+A copy of the license is included in the section entitled ``GNU Free Documentation License''.
+</html>
-- 
1.7.10.4

From e291dc24849f4ec113fc78683fdf27784f1d97da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 09:48:46 +0200
Subject: [PATCH 04/13] Add test cases for patch of gfdl

Add some test case for gfdl patches
---
 .../cruft-gfdl-invariants/debian/src/patch-R.diff    |    7 +++++++
 .../cruft-gfdl-invariants/debian/src/patch-c0.diff   |   18 ++++++++++++++++++
 .../cruft-gfdl-invariants/debian/src/patch-u.diff    |    9 +++++++++
 .../cruft-gfdl-invariants/debian/src/patch-uR.diff   |    9 +++++++++
 t/tests/cruft-gfdl-invariants/debian/src/patch.diff  |    7 +++++++
 5 files changed, 50 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/patch-R.diff
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/patch-c0.diff
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/patch-u.diff
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/patch-uR.diff
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/patch.diff

diff --git a/t/tests/cruft-gfdl-invariants/debian/src/patch-R.diff b/t/tests/cruft-gfdl-invariants/debian/src/patch-R.diff
new file mode 100644
index 0000000..73e379b
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/patch-R.diff
@@ -0,0 +1,7 @@
+1,6d0
+< 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, no Front-Cover Texts and
+< no Back-Cover Texts.  A copy of the license is included in the
+< section entitled "GNU Free Documentation License".
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/patch-c0.diff b/t/tests/cruft-gfdl-invariants/debian/src/patch-c0.diff
new file mode 100644
index 0000000..600653e
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/patch-c0.diff
@@ -0,0 +1,18 @@
+*** make-stds.texi	2013-02-17 21:44:05.485250349 +0100
+--- normal.texi	2012-12-20 21:23:22.829397718 +0100
+***************
+*** 1,7 ****
+! @c Permission is granted to copy, distribute and/or modify this document
+! @c under the terms of the GNU Free Documentation License, Version 1.1
+! @c or any later version published by the Free Software Foundation;
+! @c with no Invariant Sections, with no
+! @c Front-Cover Texts, and with no Back-Cover Texts.
+! @c A copy of the license is included in the section entitled ``GNU
+! @c Free Documentation License''.
+--- 1,6 ----
+! 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, no Front-Cover Texts and
+! no Back-Cover Texts.  A copy of the license is included in the
+! section entitled "GNU Free Documentation License".
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/patch-u.diff b/t/tests/cruft-gfdl-invariants/debian/src/patch-u.diff
new file mode 100644
index 0000000..db6e4f9
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/patch-u.diff
@@ -0,0 +1,9 @@
+--- /dev/null	2013-05-15 23:18:30.206386135 +0200
++++ normal.texi	2012-12-20 21:23:22.829397718 +0100
+@@ -0,0 +1,6 @@
++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, no Front-Cover Texts and
++no Back-Cover Texts.  A copy of the license is included in the
++section entitled "GNU Free Documentation License".
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/patch-uR.diff b/t/tests/cruft-gfdl-invariants/debian/src/patch-uR.diff
new file mode 100644
index 0000000..347adff
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/patch-uR.diff
@@ -0,0 +1,9 @@
+--- normal.texi	2012-12-20 21:23:22.829397718 +0100
++++ /dev/null	2013-05-15 23:18:30.206386135 +0200
+@@ -1,6 +0,0 @@
+-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, no Front-Cover Texts and
+-no Back-Cover Texts.  A copy of the license is included in the
+-section entitled "GNU Free Documentation License".
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/patch.diff b/t/tests/cruft-gfdl-invariants/debian/src/patch.diff
new file mode 100644
index 0000000..f64bfaf
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/patch.diff
@@ -0,0 +1,7 @@
+0a1,6
+> 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, no Front-Cover Texts and
+> no Back-Cover Texts.  A copy of the license is included in the
+> section entitled "GNU Free Documentation License".
-- 
1.7.10.4

From cd9b50883c1b9e78b5e008377e8c2e486caf03f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 09:54:37 +0200
Subject: [PATCH 06/13] Zero is normally plural check also for singular
 mistake

In french and latin lanquage zero (or none) is singular. Check for translation mistake
---
 t/tests/cruft-gfdl-invariants/debian/src/zeroisnotplural.texi |    6 ++++++
 1 file changed, 6 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/zeroisnotplural.texi

diff --git a/t/tests/cruft-gfdl-invariants/debian/src/zeroisnotplural.texi b/t/tests/cruft-gfdl-invariants/debian/src/zeroisnotplural.texi
new file mode 100644
index 0000000..8782eed
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/zeroisnotplural.texi
@@ -0,0 +1,6 @@
+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 Section, no Front-Cover Text and
+no Back-Cover Text.  A copy of the license is included in the
+section entitled "GNU Free Documentation License".
-- 
1.7.10.4

From fec33214c68e7eb7c4c27c6df4ff56381c35870c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 10:03:10 +0200
Subject: [PATCH 07/13] Be more liberal about <br/>

Allow also <br /> and avoid some false positive.
---
 checks/cruft                                                        |    2 +-
 t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/checks/cruft b/checks/cruft
index cf77f5b..54bb923 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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-|\n!|\n<|\n>|<br/>)';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>|<br\s?/>)';
                         # 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/gfdllicenseexamplesbr.html b/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html
index fffca61..46cbd2f 100644
--- a/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html
+++ b/t/tests/cruft-gfdl-invariants/debian/src/gfdllicenseexamplesbr.html
@@ -6,7 +6,7 @@ Copyright (C)  year  your name.
 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 the Invariant Sections being <var>list their titles</var>, with
+with the<br/> Invariant Sections<br /> being <var>list their titles</var>, with
 the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
 being <var>list</var>.
 A copy of the license is included in the section entitled ``GNU Free Documentation License''.
-- 
1.7.10.4

From 2b6303000afe48461b067a5892b8b0c38ff0fb3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 10:40:15 +0200
Subject: [PATCH 08/13] Be more liberal about gfdl on linking words

And, with etc on the no invariants section could be ommited by upstream.
---
 checks/cruft                                               |    6 +++---
 t/tests/cruft-gfdl-invariants/debian/src/normalbkchem.texi |    6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/normalbkchem.texi

diff --git a/checks/cruft b/checks/cruft
index 54bb923..9e37ef5 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -488,9 +488,9 @@ sub find_cruft {
                         # GFDL license, assume it is bad unless it
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
-                            when(m/with $s+ (?:the$s+)? no $s+ Invariant $s+ Sections?,?
-                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts?,? $s+ and
-                                        $s+ (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts?/xiso) {
+                            when(m/(?:the$s+)? no $s+ Invariant $s+ Sections?,?
+                                    $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-Cover $s+ Texts?,? $s+ (?:and$s+)?
+                                        (?:with$s+)? (?:the$s+)? no $s+ Back-Cover $s+ Texts?/xiso) {
                                 # no invariant
                             }
                             when(m/with $s+ the $s+ Invariant $s+ Sections $s+ being
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/normalbkchem.texi b/t/tests/cruft-gfdl-invariants/debian/src/normalbkchem.texi
new file mode 100644
index 0000000..dd888e2
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/normalbkchem.texi
@@ -0,0 +1,6 @@
+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; no Invariant Sections, no Front-Cover Texts,
+no Back-Cover Texts.  A copy of the license is included in the
+section entitled "GNU Free Documentation License".
-- 
1.7.10.4

From e441e02505df8e6d71f2abf70eb0c60d537d4d88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 10:48:17 +0200
Subject: [PATCH 09/13] Allow man comments for gfdl invariants

Fix a false positive problem by allowing man comments
---
 checks/cruft                                                  |    2 +-
 t/tests/cruft-gfdl-invariants/debian/src/normalmancomment.txt |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/normalmancomment.txt

diff --git a/checks/cruft b/checks/cruft
index 9e37ef5..8d2d40c 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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-|\n!|\n<|\n>|<br\s?/>)';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>|<br\s?/>|\n\.\\\")';
                         # 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/normalmancomment.txt b/t/tests/cruft-gfdl-invariants/debian/src/normalmancomment.txt
new file mode 100644
index 0000000..8d0f3a4
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/normalmancomment.txt
@@ -0,0 +1,6 @@
+.\" manual page for blaze, a command wrapper for BlazeBlogger
+.\"
+.\" 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, no Front-Cover Texts, and no Back-Cover Texts.
-- 
1.7.10.4

From 54bae908a76cd273d12032e556f57fb8c38ff97a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 11:06:38 +0200
Subject: [PATCH 10/13] Allow C comments continuation

* is sometimes used for alignment of C comments. Allow it.
---
 checks/cruft                                      |    2 +-
 t/tests/cruft-gfdl-invariants/debian/src/normal.c |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/normal.c

diff --git a/checks/cruft b/checks/cruft
index 8d2d40c..a2c00e8 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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-|\n!|\n<|\n>|<br\s?/>|\n\.\\\")';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>|<br\s?/>|\n\.\\\"|\*)';
                         # 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/normal.c b/t/tests/cruft-gfdl-invariants/debian/src/normal.c
new file mode 100644
index 0000000..a58e927
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/normal.c
@@ -0,0 +1,13 @@
+ /*****************************************************************************/
+/** \mainpage Cal3D API Reference
+  * <center>
+  *   <p>
+  *     Permission is granted to copy, distribute and/or modify this document
+  *     under the terms of the GNU Free Documentation License, Version 1.1 or
+  *     any later version published by the Free Software Foundation;
+  *     with no Invariant Sections, no Front-Cover Texts and
+  *     no Back-Cover Texts;
+  *     A copy of the license is included in the section entitled
+  *     \link license "GNU Free Documentation License" \endlink .
+  * </center>
+  *****************************************************************************/
-- 
1.7.10.4

From d5bd28c3d986b16aed6cfc646542f0e2e55e07db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 11:49:32 +0200
Subject: [PATCH 12/13] Fix a false positive for the gfdl check in case of GNU
 with under <span> tags

diveintopython trigger false positive due to convoluted license. The solution is better matching
of the license by allowing some HTML tags durings scanning of license text.
---
 checks/cruft                                               |    2 +-
 .../cruft-gfdl-invariants/debian/src/diveintopythonok.html |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/diveintopythonok.html

diff --git a/checks/cruft b/checks/cruft
index 032fbe0..4dec077 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -480,7 +480,7 @@ sub find_cruft {
                 # if the "redeeming" part is in the next block.
                 #
                 # See cruft-gfdl-fp-sliding-win for the test case
-                when(m/GNU \s+ Free \s+ Documentation \s+ License (?'gfdlsections'.{0,1024})
+                when(m/GNU (?:\s+|\s*<\/span>\s*)? Free \s+ Documentation \s+ License (?'gfdlsections'.{0,1024})
                          A \s+ copy \s+ of \s+ the \s+ license \s+ is \s+ included/xis) {
                     if (!exists $licenseproblemhash{'gfdl-invariants'}) {
                         # local space
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/diveintopythonok.html b/t/tests/cruft-gfdl-invariants/debian/src/diveintopythonok.html
new file mode 100644
index 0000000..f5c0999
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/diveintopythonok.html
@@ -0,0 +1,12 @@
+<html>
+<!--- This is a old false positive -->
+<body>
+                  <div class="legalnotice">
+                     <p>Permission is granted to copy, distribute, and/or modify this document under the terms of the <span class="acronym">GNU</span> Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant
+                        Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the license is included in <a href="../appendix/fdl.html" title="Appendix&nbsp;G.&nbsp;GNU Free Documentation License">Appendix&nbsp;G, <i>GNU Free Documentation License</i></a>.
+                     </p>
+                     <p>The example programs in this book are free software; you can redistribute and/or modify them under the terms of the <span class="application">Python</span> license as published by the <span class="application">Python</span> Software Foundation. A copy of the license is included in <a href="../appendix/license.html" title="Appendix&nbsp;H.&nbsp;Python license">Appendix&nbsp;H, <i>Python license</i></a>.
+                     </p>
+                  </div>
+</body>
+</html>
\ No newline at end of file
-- 
1.7.10.4

From 27caec388d27a23c04b2ba63b0953f4efe30401c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 19 May 2013 12:46:32 +0200
Subject: [PATCH 13/13] Fix false positive for detection of gfdl license
 problem

If text is embeded in C string we have false positive.
Fix it.
---
 checks/cruft                                           |    2 +-
 t/tests/cruft-gfdl-invariants/debian/src/findutilsok.c |   15 +++++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/findutilsok.c

diff --git a/checks/cruft b/checks/cruft
index 4dec077..8117a1f 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -484,7 +484,7 @@ 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-|\n!|\n<|\n>|<br\s?/>|\n\.\\\"|\*)';
+                        my $s = '(?:\s|\@c|%|\n\+|\n-|\n!|\n<|\n>|<br\s?/>|\n\.\\\"|\*|\"|,\")';
                         # 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
+    };
-- 
1.7.10.4


Reply to: