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

[SCM] Debian package checker branch, master, updated. 2.1.2-18-g3fe9fb0



The following commit has been merged in the master branch:
commit 3fe9fb02a4470136255aac4962e675881e3ba3c3
Author: Russ Allbery <rra@debian.org>
Date:   Sat Dec 27 14:15:45 2008 -0800

    Fix override-file-in-wrong-location
    
    * checks/files{,.desc}:
      + [RA] Move the check for override files in the wrong location so that
        the check for subdirectories of /usr/share/lintian/overrides works
        and improve the tag description.

diff --git a/checks/files b/checks/files
index 7ffbccf..e536df6 100644
--- a/checks/files
+++ b/checks/files
@@ -223,15 +223,8 @@ foreach my $file (sort keys %{$info->index}) {
 		    }
 		}
 
-		# override files have moved
-		my $tmp = quotemeta($pkg);
-		if ($file =~ m,^usr/share/doc/$tmp/override\.[lL]intian(\.gz)?$,) {
-		    tag "override-file-in-wrong-location", "$file";
-		} elsif ($file =~ m,^usr/share/lintian/overrides/$tmp/.*,) {
-		    tag "override-file-in-wrong-location", "$file";
-		}
-
 		# contains an INSTALL file?
+		my $tmp = quotemeta($pkg);
 		if ($file =~ m,^usr/share/doc/$tmp/INSTALL(?:\..+)*$,) {
 		    tag "package-contains-upstream-install-documentation", "$file";
 		}
@@ -572,6 +565,13 @@ foreach my $file (sort keys %{$info->index}) {
 	tag "file-name-ends-in-whitespace", "$file";
     }
 
+    # ---------------- misplaced lintian overrides
+    my $tmp = quotemeta($pkg);
+    if ($file =~ m,^usr/share/doc/$tmp/override\.[lL]intian(\.gz)?$, or
+	$file =~ m,^usr/share/lintian/overrides/$tmp/.+,) {
+	tag "override-file-in-wrong-location", "$file";
+    }
+
     # ---------------- plain files
     if ($index_info->{type} =~ m/^[-h]/) {
 	my $wanted_operm;
diff --git a/checks/files.desc b/checks/files.desc
index 225757b..c44c6ad 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -640,9 +640,11 @@ Info: The documentation directory for this package contains an empty
 Tag: override-file-in-wrong-location
 Severity: important
 Certainty: certain
-Info: Location of per package overrides the file
- /usr/share/lintian/overrides/package.  See the lintian documentation for more
- info on proper naming and format.
+Info: Lintian overrides should be put in a regular file named
+ /usr/share/lintian/overrides/<tt>package</tt>, not in a subdirectory
+ named for the package or in the obsolete location under /usr/share/doc.
+ See the Lintian documentation for more information on proper naming and
+ format.
 Ref: lintian 2.4
 
 Tag: package-contains-upstream-install-documentation
diff --git a/debian/changelog b/debian/changelog
index 80643e0..6bd54b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,9 @@ lintian (2.1.3) UNRELEASED; urgency=low
       from zero-byte-file-in-doc-directory.  Improve the tag description
       to add a rationale and a suggestion for when overrides are
       appropriate.  Lower the certainty to possible.  (Closes: #507273)
+    + [RA] Move the check for override files in the wrong location so that
+      the check for subdirectories of /usr/share/lintian/overrides works
+      and improve the tag description.
   * checks/nmu:
     + [RA] Recognize Ubuntu native packages by the target distribution and
       suppress NMU tags for them.  Based on a patch by Adrien Cunin.
diff --git a/t/tests/6000_files-override-misplaced.desc b/t/tests/6000_files-override-misplaced.desc
new file mode 100644
index 0000000..d8bb58b
--- /dev/null
+++ b/t/tests/6000_files-override-misplaced.desc
@@ -0,0 +1,4 @@
+Testname: files-override-misplaced
+Version: 1.0
+Description: Check for misplaced override file detection
+Test-For: override-file-in-wrong-location
diff --git a/t/tests/files-override-misplaced/debian/Makefile b/t/tests/files-override-misplaced/debian/Makefile
new file mode 100644
index 0000000..cd6a7ca
--- /dev/null
+++ b/t/tests/files-override-misplaced/debian/Makefile
@@ -0,0 +1,16 @@
+ROOT = $(DESTDIR)/usr/share/doc/files-override-misplaced
+
+default:
+	:
+
+install:
+	mkdir -p $(DESTDIR)/usr/share/doc/files-override-misplaced
+	echo 'files-override-misplaced: some-override' \
+	    > $(DESTDIR)/usr/share/doc/files-override-misplaced/override.lintian
+	echo 'files-override-misplaced: some-override' \
+	    > $(DESTDIR)/usr/share/doc/files-override-misplaced/override.Lintian
+	gzip -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
+
+.PHONY: clean distclean realclean install check test
diff --git a/t/tests/files-override-misplaced/tags b/t/tests/files-override-misplaced/tags
new file mode 100644
index 0000000..1b1442d
--- /dev/null
+++ b/t/tests/files-override-misplaced/tags
@@ -0,0 +1,3 @@
+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

-- 
Debian package checker


Reply to: