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

Bug#711119: [lintian] Another false positive in gfdl



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


--- Please enter the report below this line. ---


--- System information. ---
Architecture: amd64
Kernel:       Linux 3.7-trunk-amd64

Debian Release: jessie/sid

--- Package information. ---
Depends                             (Version) | Installed
=============================================-+-============
binutils                                      | 2.22-8
bzip2                                         | 1.0.6-4
diffstat                                      | 1.55-3
file                                          | 1:5.14-2
gettext                                       | 0.18.1.1-10
hardening-includes                  (>= 2.2~) | 2.3
intltool-debian                               | 0.35.0+20060710.1
libapt-pkg-perl                               | 0.1.28
libarchive-zip-perl                           | 1.30-6
libc-bin                           (>= 2.13)  | 2.17-3
 OR locales                                   | 2.17-3
libclass-accessor-perl                        | 0.34-1
libclone-perl                                 | 0.34-1
libdigest-sha-perl                            | 
libdpkg-perl                                  | 1.16.10
libemail-valid-perl                           | 0.190-1
libfile-basedir-perl                          | 0.03-1
libipc-run-perl                               | 0.92-1
liblist-moreutils-perl                        | 0.33-1+b1
libparse-debianchangelog-perl                 | 1.2.0-1
libtext-levenshtein-perl                      | 0.06~01-2
libtimedate-perl                              | 1.2000-1
liburi-perl                                   | 1.60-1
man-db                                        | 2.6.3-6
patchutils                                    | 0.3.2-1.1
perl                                          | 5.14.2-21
perl                              (>= 5.14~)  | 5.14.2-21
 OR libautodie-perl                (>= 2.10~) | 
t1utils                                       | 1.37-2


Package's Recommends field is empty.

Suggests                     (Version) | Installed
======================================-+-=============
binutils-multiarch                     | 2.22-8
dpkg-dev                               | 1.16.10
libhtml-parser-perl                    | 3.71-1
libperlio-gzip-perl                    | 0.18-1+b2
libtext-template-perl                  | 1.45-2
lzma                                   | 
man-db                    (>= 2.5.1-1) | 2.6.3-6
xz-utils                               | 5.1.1alpha+20120614-2
From 1cff7b4022ba43a658a6445ae9f38fe4e494c742 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Mon, 3 Jun 2013 22:26:04 +0200
Subject: [PATCH 1/4] Fix a false positive due to groff

\- is a hyphen in man pages. Allow it
---
 checks/cruft                                       |   12 +--
 .../hyphen-used-as-minus-sign.diff                 |  102 ++++++++++++++++++++
 2 files changed, 108 insertions(+), 6 deletions(-)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/hyphen-used-as-minus-sign.diff

diff --git a/checks/cruft b/checks/cruft
index f25dcf3..f19a12a 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -508,20 +508,20 @@ sub find_cruft {
                         # explicitly states it has no "bad sections".
                         given($+{gfdlsections}) {
                             when(m/no $s* Invariant $s+ Sections? $s* ,?
-                                   $s+ (?:with$s+)? (?:the$s+)? no $s+ Front-$s*Cover $s+ Texts? $s* ,? $s+ (?:and$s+)?
-                                       (?:with$s+)? (?:the$s+)? no $s+ Back-$s*Cover $s+ Texts?/xiso) {
+                                   $s+ (?:with$s+)? (?:the$s+)? no $s+ Front(?:\\?-)?$s*Cover $s+ Texts? $s* ,? $s+ (?:and$s+)?
+                                       (?:with$s+)? (?:the$s+)? no $s+ Back(?:\\?-)?$s*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) {
+                                      $s+ (?:no$s+)? Front(?:[\\]?-)? $s+ or
+                                      $s+ (?:no$s+)? Back(?:[\\]?-)?$s*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
+                                        $s+ with $s+ the $s+ Front(?:[\\]?-)$s*Cover $s+ Texts $s+ being
                                         $s+ (?:\@var\{|<var>)? LIST (?:\}|<\/var>)? $s* ,?
-                                        $s+ and $s+ with $s+ the $s+ Back-Cover $s+ Texts $s+ being
+                                        $s+ and $s+ with $s+ the $s+ Back(?:[\\]?-)$s*Cover $s+ Texts $s+ being
                                         $s+ (?:\@var\{|<var>)? LIST (?:\}|<\/var>)?/xiso) {
                                 # verbatim text of license is ok
                             }
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/hyphen-used-as-minus-sign.diff b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/hyphen-used-as-minus-sign.diff
new file mode 100644
index 0000000..ae8c973
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/hyphen-used-as-minus-sign.diff
@@ -0,0 +1,102 @@
+Description: hyphen-used-as-minus-sign
+ This manual page seems to contain a hyphen where a minus sign was 
+ intended.
+Author: Ruben Molina <rmolina@udea.edu.co>
+Forwarded: no
+Last-Update: 2011-06-25
+
+Index: kst-2.0.3/src/kst/kst.1.txt
+===================================================================
+--- kst-2.0.3.orig/src/kst/kst.1.txt
++++ kst-2.0.3/src/kst/kst.1.txt
+@@ -47,7 +47,7 @@ kst may be run entirely from within its
+ command line arguments are needed.  kst has a powerful wizard for
+ easily setting up new plots.  
+ 
+-In the second invocation, kst loads pre-saved plot specifications from the
++In the second invocation, kst loads pre\-saved plot specifications from the
+ file
+ .I kstfile
+ and optionally may override some of the settings in that file.
+@@ -64,7 +64,7 @@ plot all curves in separate plots
+ .TP
+ .B \-a\fR
+ average frames (simple mean) when plotting with
+-.B -s\fR.
++.B \-s\fR.
+ .TP
+ .B \-\-A4\fR
+ use A4 sized paper for printing.  Requires
+@@ -90,7 +90,7 @@ and instead use
+ .B \-f\ STARTFRAME\fR
+ begin plotting at
+ .I STARTFRAME
+-frames into the data.  Set to -1 to start at
++frames into the data.  Set to \-1 to start at
+ .I NUMFRAMES
+ from the end of the data.
+ .TP
+@@ -112,7 +112,7 @@ use US Letter sized paper for printing.
+ .B \-n\ NUMFRAMES\fR
+ plot at most
+ .I NUMFRAMES
+-frames of data.  Set to -1 to indicate all of the data.
++frames of data.  Set to \-1 to indicate all of the data.
+ .TP
+ .B \-P\ PLOTNAME\fR
+ plot all plots in the plot named
+@@ -145,7 +145,7 @@ frames when plotting.
+ .B \-x\ FIELD\fR
+ use
+ .I FIELD
+-as the X-axis vector.
++as the X\-axis vector.
+ .TP
+ .B \-y\ FIELD\fR
+ plot
+@@ -158,30 +158,30 @@ plot
+ as an image.
+ .SH EXAMPLES
+ Plot all data in column 2 from data.dat.
+-       kst data.dat -y 2
++       kst data.dat \-y 2
+ 
+ Same as above, except only read 20 lines, starting at line 10.
+-       kst data.dat -f 10 -n 20 -y 2
++       kst data.dat \-f 10 \-n 20 \-y 2
+ 
+ also read col 1. One plot per curve.
+-       kst data.dat -f 10 -n 20 -y 1 -y 2
++       kst data.dat \-f 10 \-n 20 \-y 1 \-y 2
+ 
+ Read col 1 from data2.dat and col 1 from data.dat
+-       kst data.dat -f 10 -n 20 -y 2 data2.dat -y 1
++       kst data.dat \-f 10 \-n 20 \-y 2 data2.dat \-y 1
+ 
+ Same as above, except read 40 lines starting at 30 in data2.dat
+-       kst data.dat -f 10 -n 20 -y 2 data2.dat -f 30 -n 40 -y 1
++       kst data.dat \-f 10 \-n 20 \-y 2 data2.dat \-f 30 \-n 40 \-y 1
+ 
+ Specify the X vector and error bars:
+ Plot x = col 1 and Y = col 2 and error flags = col 3 from data.dat
+-       kst data.dat -x 1 -e 3 -y 2
++       kst data.dat \-x 1 \-e 3 \-y 2
+ 
+ Get the X vector from data1.dat, and the Y vector from data2.dat.
+-       kst data1.dat -x 1 data2.dat -y 1
++       kst data1.dat \-x 1 data2.dat \-y 1
+ 
+ Placement:
+ Plot column 2 and column 3 in plot P1 and column 4 in plot P2
+-       kst data.dat -P P1 -y 2 -y 3 -P P2 -y 4
++       kst data.dat \-P P1 \-y 2 \-y 3 \-P P2 \-y 4
+ .SH BUGS
+ Please report bugs to either the kst mailing list at
+ .I kst@kde.org
+@@ -198,6 +198,6 @@ Matthew Truch <matt@truch.net>
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.2 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 `COPYING.DOC' file
+ as part of the kst distribution.
-- 
1.7.10.4

From 1ec2e05c51f9836e87a4f31755461a2e4976dd12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Mon, 3 Jun 2013 22:36:12 +0200
Subject: [PATCH 2/4] Fix another false positive due to a redactional variant.

Found in libnss-pgsql
---
 checks/cruft                                                  |    9 +++++++++
 .../debian/src/oldfalsepositive/libnss-pgsql.xml              |    7 +++++++
 2 files changed, 16 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/libnss-pgsql.xml

diff --git a/checks/cruft b/checks/cruft
index f19a12a..1b4815d 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -517,6 +517,15 @@ sub find_cruft {
                                       $s+ (?:no$s+)? Back(?:[\\]?-)?$s*Cover $s+ Texts?/xiso) {
                                 # no invariant variant (dict-foldoc)
                             }
+                            when(m/\A $s* (?:(?:\,|\.|;)$s*)? version $s+ \d+(?:\.\d+)? $s+
+                                   (?:or $s+ any $s+ later $s+ version $s+)?
+                                   published $s+ by $s+ the $s+ Free $s+ Software $s+ Foundation $s*
+                                   (?:(?:\,|\.|;)$s*)? 
+                                   There $s+ are $s+ no $s+ invariants? $s+ sections? 
+                                   (?:(?:\,|\.|;)$s*)? \z
+                                   /xiso) {
+                                # no invariant libnss-pgsql version
+                            }   
                             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(?:[\\]?-)$s*Cover $s+ Texts $s+ being
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/libnss-pgsql.xml b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/libnss-pgsql.xml
new file mode 100644
index 0000000..2e2ea67
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/libnss-pgsql.xml
@@ -0,0 +1,7 @@
+      <para>
+	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. There
+	are no invariant sections. A copy of the license is included in the
+	section entitled "GNU Free Documentation License".
+      </para>
\ No newline at end of file
-- 
1.7.10.4

From f80d61efbdcfb7a5233c5d38d0a30293f63bf37b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Tue, 4 Jun 2013 09:27:25 +0200
Subject: [PATCH 3/4] Fix a false positive in maintain.texi

Maitain.texi and associated file aka html/maitain/section/ have a false positive due to an example.

Allow:
Following is an example of the license notice to use after the copyright line(s)
using all the features of the GFDL.
@smallexample
Permission is granted to copy, distribute and
...
---
 checks/cruft                                              |   13 +++++++++++++
 .../debian/src/oldfalsepositive/maintain.texi             |   13 +++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/maintain.texi

diff --git a/checks/cruft b/checks/cruft
index 1b4815d..36a77ac 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -502,6 +502,7 @@ sub find_cruft {
                           <br\s*/?>       |  # (X)HTML line breaks
                           </?link.*?>     |  # xml link
                           </?a.*?>        |  # a link
+                          </?p.*?>        |  # html link
                           \(\*note.*?::\) |  # info file note
                         )}xiso;
                         # GFDL license, assume it is bad unless it
@@ -552,6 +553,18 @@ sub find_cruft {
                                     $licenseproblemhash{'gfdl-invariants'} = 1;
                                 }
                             }
+                            # fix a false positive in maintain.texi
+                            when(m/\A $s* \. $s*
+                                   Following $s+ is $s+ an $s+ example $s+ of $s+ the $s+ license $s+ notice $s+ 
+                                   to $s+ use $s+ after $s+ the $s+ copyright $s+ line\(s\) $s+ using $s+ all $s+ the $s+
+                                   features $s+ of $s+ the $s+ GFDL/xiso) 
+                            {
+                                # allow only one text
+                                unless($name =~ m/maintain/) {
+                                    tag 'license-problem-gfdl-invariants', $name;
+                                    $licenseproblemhash{'gfdl-invariants'} = 1;
+                                }
+                            }
                             default {
                                 tag 'license-problem-gfdl-invariants', $name;
                                 $licenseproblemhash{'gfdl-invariants'} = 1;
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/maintain.texi b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/maintain.texi
new file mode 100644
index 0000000..633e758
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/maintain.texi
@@ -0,0 +1,13 @@
+Documentation files should have license notices also.  Manuals should
+use the GNU Free Documentation License.  Following is an example of the
+license notice to use after the copyright line(s) using all the
+features of the GFDL.
+
+@smallexample
+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 ``GNU General Public License'', with the
+Front-Cover Texts being ``A GNU Manual'', and with the Back-Cover Texts
+as in (a) below.  A copy of the license is included in the section
+entitled ``GNU Free Documentation License''.
-- 
1.7.10.4

From 5d9614bcbe78cd724848fe8f82987a84a8ab9ce2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Tue, 4 Jun 2013 14:41:58 +0200
Subject: [PATCH 4/4] Add false positive due to variant of formulation

Avoid a false positive
---
 checks/cruft                                                  |    9 +++++++++
 .../debian/src/oldfalsepositive/lilypond.texi                 |    6 ++++++
 2 files changed, 15 insertions(+)
 create mode 100644 t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/lilypond.texi

diff --git a/checks/cruft b/checks/cruft
index 36a77ac..92ed388 100644
--- a/checks/cruft
+++ b/checks/cruft
@@ -527,6 +527,15 @@ sub find_cruft {
                                    /xiso) {
                                 # no invariant libnss-pgsql version
                             }   
+                            when(m/(?:(?:\,|\.|;)$s*)? version $s+ \d+(?:\.\d+)? $s+
+                                   (?:or $s+ any $s+ later $s+ version $s+)?
+                                   published $s+ by $s+ the $s+ Free $s+ Software $s+ Foundation $s*
+                                   (?:(?:\,|\.|;)$s*)? 
+                                   with $s+ no $s+ invariants? $s+ sections? 
+                                   (?:(?:\,|\.|;)$s*)? \z
+                                   /xiso) {
+                                # no invariant lilypond version
+                            }
                             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(?:[\\]?-)$s*Cover $s+ Texts $s+ being
diff --git a/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/lilypond.texi b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/lilypond.texi
new file mode 100644
index 0000000..56939ee
--- /dev/null
+++ b/t/tests/cruft-gfdl-invariants/debian/src/oldfalsepositive/lilypond.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.1
+or any later version published by the Free Software Foundation;
+with no Invariant Sections.
+A copy of the license is included in the section entitled ``GNU
+Free Documentation License''.
-- 
1.7.10.4


Reply to: