This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 47a6f14e2c506551971291b75a43c4b6c0ed0066
Author: Chris Lamb <la...@debian.org>
Date:   Wed Aug 9 08:38:26 2017 -0400

    Check for Lintian overrides installed in the wrong package. (Closes: 
#792198)
---
 checks/files.desc                                | 8 ++++++++
 checks/files.pm                                  | 2 ++
 debian/changelog                                 | 2 ++
 t/tests/files-override-misplaced/debian/Makefile | 2 ++
 t/tests/files-override-misplaced/desc            | 4 +++-
 t/tests/files-override-misplaced/tags            | 1 +
 6 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/checks/files.desc b/checks/files.desc
index 4d7956a..639fe26 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1751,3 +1751,11 @@ Info: The package installs files into the 
<tt>/etc/init</tt>
  .
  However, Upstart was removed in Debian "stretch" and these files are thus no
  longer useful and should be removed.
+
+Tag: override-file-in-wrong-package
+Severity: important
+Certainty: certain
+Info: This package includes Lintian overrides intended for another package.
+ Lintian overrides should be put in a regular file named
+ /usr/share/lintian/overrides/<tt>package</tt>
+Ref: lintian 2.4
diff --git a/checks/files.pm b/checks/files.pm
index a2baf4c..6e5f85e 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -1306,6 +1306,8 @@ sub run {
         if (   $fname =~ m,^usr/share/doc/$ppkg/override\.[lL]intian(?:\.gz)?$,
             or $fname =~ m,^usr/share/lintian/overrides/$ppkg/.+,) {
             tag 'override-file-in-wrong-location', $file;
+        } elsif ($fname =~ m,^usr/share/lintian/overrides/(.+)/.+$,) {
+            tag 'override-file-in-wrong-package', $file if $1 ne $pkg;
         }
 
         # doxygen md5sum
diff --git a/debian/changelog b/debian/changelog
index 2c7e05d..2e843de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -165,6 +165,8 @@ lintian (2.5.52) unstable; urgency=medium
       to Rene Engelhard for the report.  (Closes: #856137)
     + [CL] Check for packages containing upstart configuration under
       /etc/init. Thanks to Paul Wise for the report.  (Closes: #825348)
+    + [CL] Check for Lintian overrides installed in the wrong package.
+      (Closes: #792198)
   * checks/init.d.desc:
     + [CL] Add an example snippet to explain how to prevent emission
       of init.d-script-sourcing-without-test.
diff --git a/t/tests/files-override-misplaced/debian/Makefile 
b/t/tests/files-override-misplaced/debian/Makefile
index 6819f29..a4c0682 100644
--- a/t/tests/files-override-misplaced/debian/Makefile
+++ b/t/tests/files-override-misplaced/debian/Makefile
@@ -12,5 +12,7 @@ install:
        gzip -n -9 
$(DESTDIR)/usr/share/doc/files-override-misplaced/override.Lintian
        mkdir -p $(DESTDIR)/usr/share/lintian/overrides/files-override-misplaced
        touch 
$(DESTDIR)/usr/share/lintian/overrides/files-override-misplaced/some-override
+       mkdir -p $(DESTDIR)/usr/share/lintian/overrides/wrong-package
+       touch $(DESTDIR)/usr/share/lintian/overrides/wrong-package/some-override
 
 .PHONY: clean distclean realclean install check test
diff --git a/t/tests/files-override-misplaced/desc 
b/t/tests/files-override-misplaced/desc
index d8bb58b..9b422ef 100644
--- a/t/tests/files-override-misplaced/desc
+++ b/t/tests/files-override-misplaced/desc
@@ -1,4 +1,6 @@
 Testname: files-override-misplaced
 Version: 1.0
 Description: Check for misplaced override file detection
-Test-For: override-file-in-wrong-location
+Test-For:
+ override-file-in-wrong-location
+ override-file-in-wrong-package
diff --git a/t/tests/files-override-misplaced/tags 
b/t/tests/files-override-misplaced/tags
index 1b1442d..1702446 100644
--- a/t/tests/files-override-misplaced/tags
+++ b/t/tests/files-override-misplaced/tags
@@ -1,3 +1,4 @@
 E: files-override-misplaced: override-file-in-wrong-location 
usr/share/doc/files-override-misplaced/override.Lintian.gz
 E: files-override-misplaced: override-file-in-wrong-location 
usr/share/doc/files-override-misplaced/override.lintian
 E: files-override-misplaced: override-file-in-wrong-location 
usr/share/lintian/overrides/files-override-misplaced/some-override
+E: files-override-misplaced: override-file-in-wrong-package 
usr/share/lintian/overrides/wrong-package/some-override

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/lintian/lintian.git

Reply via email to