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

[SCM] Debian package checker branch, master, updated. 2.1.2-17-gb0dc93d



The following commit has been merged in the master branch:
commit b0dc93d000b7eea32c96d79f41e61ce5d22379a5
Author: Russ Allbery <rra@debian.org>
Date:   Sat Dec 27 13:29:44 2008 -0800

    Improve zero-byte-file-in-doc-directory tag
    
    * checks/files{,.desc}:
      + [RA] Exclude __init__.py files and Doxygen-generated *.map files
        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)

diff --git a/checks/files b/checks/files
index 5015fdc..7ffbccf 100644
--- a/checks/files
+++ b/checks/files
@@ -206,8 +206,12 @@ foreach my $file (sort keys %{$info->index}) {
 
 		# zero byte file in /usr/share/doc/
 		if ($index_info->{size} == 0 and $index_info->{type} =~ m,^-,) {
-		    # exception: examples may contain empty files for various reasons
-		    unless ($file =~ m,^usr/share/doc/([^/]+/)?examples/,) {
+		    # Exceptions: examples may contain empty files for various
+		    # reasons, Doxygen generates empty *.map files, and Python
+		    # uses __init__.py to mark module directories.
+		    unless ($file =~ m,^usr/share/doc/([^/]+/)?examples/,
+			    or $file =~ m,^usr/share/doc/(.+/)?html/.*\.map$,
+			    or $file =~ m,^usr/share/doc/(.+/)?__init__\.py$,) {
 			tag "zero-byte-file-in-doc-directory", "$file";
 		    }
 		}
diff --git a/checks/files.desc b/checks/files.desc
index 60f5f0f..225757b 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -627,8 +627,15 @@ Ref: perl-policy 4.1
 
 Tag: zero-byte-file-in-doc-directory
 Severity: normal
-Certainty: certain
-Info: Package contains a file which is empty.
+Certainty: possible
+Info: The documentation directory for this package contains an empty
+ file.  This is often due to installing an upstream NEWS or README file
+ without realizing it's empty and hence not useful.
+ .
+ Files in the examples subdirectory are excluded from this check, but
+ there are some cases where empty files are legitimate parts of the
+ documentation without being examples.  In those cases, please add an
+ override.
 
 Tag: override-file-in-wrong-location
 Severity: important
diff --git a/debian/changelog b/debian/changelog
index 416d14e..80643e0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,11 @@ lintian (2.1.3) UNRELEASED; urgency=low
     + [RA] Check for extended descriptions shorter than three lines; they
       probably don't contain enough information.  Patch from Raphael
       Geissert.
+  * checks/files{,.desc}:
+    + [RA] Exclude __init__.py files and Doxygen-generated *.map files
+      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)
   * 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-zero-byte-doc.desc b/t/tests/6000_files-zero-byte-doc.desc
new file mode 100644
index 0000000..96c4cfe
--- /dev/null
+++ b/t/tests/6000_files-zero-byte-doc.desc
@@ -0,0 +1,6 @@
+Testname: files-zero-byte-doc
+Version: 1.0
+Section: doc
+Description: Check detection of zero-byte files in doc directories
+Test-For: zero-byte-file-in-doc-directory
+References: Debian Bug#507273
diff --git a/t/tests/files-zero-byte-doc/debian/Makefile b/t/tests/files-zero-byte-doc/debian/Makefile
new file mode 100644
index 0000000..f9336ee
--- /dev/null
+++ b/t/tests/files-zero-byte-doc/debian/Makefile
@@ -0,0 +1,29 @@
+ROOT = $(DESTDIR)/usr/share/doc/files-zero-byte-doc
+
+default:
+	:
+
+install:
+	mkdir -p $(ROOT)
+	# Should be ignored.
+	mkdir -p $(ROOT)/examples
+	touch $(ROOT)/examples/empty
+	touch $(ROOT)/__init__.py
+	mkdir -p $(ROOT)/python/foo
+	touch $(ROOT)/python/foo/__init__.py
+	mkdir -p $(ROOT)/html
+	touch $(ROOT)/html/blah.map
+	mkdir -p $(ROOT)/manual/1/html/foo
+	touch $(ROOT)/manual/1/html/foo/blah.map
+	# Should be diagnosed.
+	touch $(ROOT)/NEWS
+	touch $(ROOT)/foo__init__.py
+	touch $(ROOT)/html.map
+	touch $(ROOT)/htmlfoo.map
+	mkdir -p $(ROOT)/manual
+	touch $(ROOT)/manual/foo.map
+	gzip -9 $(ROOT)/manual/foo.map
+	touch $(ROOT)/some-really-long-file-name-to-make-the-gzip-file-larger
+	gzip -9 $(ROOT)/some-really-long-file-name-to-make-the-gzip-file-larger
+
+.PHONY: clean distclean realclean install check test
diff --git a/t/tests/files-zero-byte-doc/tags b/t/tests/files-zero-byte-doc/tags
new file mode 100644
index 0000000..5604c35
--- /dev/null
+++ b/t/tests/files-zero-byte-doc/tags
@@ -0,0 +1,6 @@
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/NEWS.gz
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/foo__init__.py
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/html.map
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/htmlfoo.map
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/manual/foo.map.gz
+W: files-zero-byte-doc: zero-byte-file-in-doc-directory usr/share/doc/files-zero-byte-doc/some-really-long-file-name-to-make-the-gzip-file-larger.gz

-- 
Debian package checker


Reply to: