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

Bug#745743: lintian: Report when a Files-Excluded field is specified without a proper copyright-format



Package: lintian
Version: 2.5.22.1
Severity: minor
Tags: patch

The Files-Excluded field in debian/copyright is used to exclude files
from our "not-so-pristine" upstream source. It is meant to discard
non-DFSG files. The field will be ignored by uscan if the copyright
file is not declared as following the format 1.0.

Note that I have not tested the patch I'm sending, I just somehow hope
it works ;-)

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.13-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lintian depends on:
ii  binutils                       2.24-5
ii  bzip2                          1.0.6-5
ii  diffstat                       1.58-1
ii  file                           1:5.17-1
ii  gettext                        0.18.3.2-1
ii  hardening-includes             2.5
ii  intltool-debian                0.35.0+20060710.1
ii  libapt-pkg-perl                0.1.29+b1
ii  libarchive-zip-perl            1.37-2
ii  libclass-accessor-perl         0.34-1
ii  libclone-perl                  0.36-1
ii  libdigest-sha-perl             5.88-1
ii  libdpkg-perl                   1.17.6
ii  libemail-valid-perl            1.192-1
ii  libfile-basedir-perl           0.03-1
ii  libipc-run-perl                0.92-1
ii  liblist-moreutils-perl         0.33-2
ii  libparse-debianchangelog-perl  1.2.0-1
ii  libtext-levenshtein-perl       0.06~01-2
ii  libtimedate-perl               2.3000-1
ii  liburi-perl                    1.60-1
ii  man-db                         2.6.6-1
ii  patchutils                     0.3.2-3
ii  perl [libdigest-sha-perl]      5.18.2-2+b1
ii  t1utils                        1.37-2

Versions of packages lintian recommends:
ii  libautodie-perl                 2.25-1
ii  libperlio-gzip-perl             0.18-2
ii  perl-modules [libautodie-perl]  5.18.2-2

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.17.6
ii  libhtml-parser-perl    3.71-1+b1
ii  libtext-template-perl  1.46-1
ii  libyaml-perl           0.84-1
ii  xz-utils               5.1.1alpha+20120614-2

-- no debconf information
diff --git a/copyright-file.desc b/copyright-file.desc
index 28683aa..0bbeef3 100644
--- a/copyright-file.desc
+++ b/copyright-file.desc
@@ -420,3 +420,17 @@ Info: The copyright file has lines ending in CRLF instead of just LF.
  <tt>CR</tt> character in the file:
  .
  <tt>sed -i 's/\r//g' path/to/file</tt>
+
+Tag: files-excluded-ignored-without-copyright-format-1.0
+Severity: serious
+Certainty: certain
+Info: You have included a Files-Excluded field in your
+ debian/copyright, but the copyright format is not declared as the
+ finalised 1.0 revision. Uscan will ignore this field.
+ .
+ Make sure your debian/copyright starts with the following line:
+ .
+ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+ .
+ Of course, you will have to use the format throughout (that is, list
+ the licenses in a programatically readable way)
diff --git a/copyright-file.pm b/copyright-file.pm
index d910fca..43f5940 100644
--- a/copyright-file.pm
+++ b/copyright-file.pm
@@ -338,6 +338,18 @@ sub run {
         }
     }
 
+    # debian/copyright has, via the Files-Excluded field, the ability
+    # to alter uscan's behaviour. uscan will ignore, though, this file
+    # if the format is not declared as copyright-format 1.0
+    #
+    # Note: I'm unsure whether it checks for version 1.0 or higher,
+    # this should probably be checked against uscan's source.
+    if (m/^Files-Excluded:/ and
+        ! m!^Format:.*doc/packaging-manuals/copyright-format/1.0!
+        ) {
+        tag 'files-excluded-ignored-without-copyright-format-1.0';
+    }
+
     return;
 } # </run>
 

Reply to: