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

[SCM] Debian package checker branch, master, updated. 2.2.13-21-g4c28b88



The following commit has been merged in the master branch:
commit 0dfdf021d1ccca5d66d5963d25a90ae08cf43505
Author: Raphael Geissert <atomo64@gmail.com>
Date:   Wed Jul 22 20:37:34 2009 +0200

    Recommend doc-base registration if PDF or HTML docs found
    
    HTML and pdf files are usually documentation and should therefore be
    registered in doc-base.
    
    The check emits the tag only if no doc-base registration file is
    provided in the package (instead of trying to look for them there) to
    reduce the number of false positives. The theory behind this is that if
    the maintainer is already shipping a doc-base registration file she
    knows what she is doing.

diff --git a/checks/menus b/checks/menus
index 8f61724..a4574f7 100644
--- a/checks/menus
+++ b/checks/menus
@@ -73,6 +73,7 @@ my $docbase_file;
 my $menu_file;
 my $menumethod_file;
 my $anymenu_file;
+my $documentation;
 
 if (-f 'control/preinst') {
     check_script($pkg, 'preinst', \%preinst);
@@ -144,6 +145,10 @@ for my $file (sort keys %{$info->index}) {
 	    tag "menu-method-should-include-menu-h", "$file"
 		unless $menumethod_includes_menu_h or $pkg eq 'menu';
 	}
+	# package doc dir?
+	elsif ( $file =~ m,^usr/share/doc/.+\.(?:html|pdf)(?:\.gz)?$, ) {
+	    $documentation = 1;
+	}
     }
 }
 close IN;
@@ -193,6 +198,8 @@ if ($docbase_file) {
 	check_doc_base_file($dbfile, $pkg, $type, \%all_files, \%all_links);
     }
     closedir DOCBASEDIR;
+} elsif ($documentation) {
+    tag "possible-documentation-but-no-doc-base-registration";
 }
 
 if ($anymenu_file) {
diff --git a/checks/menus.desc b/checks/menus.desc
index 517c514..bff2bea 100644
--- a/checks/menus.desc
+++ b/checks/menus.desc
@@ -351,3 +351,11 @@ Certainty: certain
 Info: A menu-method file must include the menu.h configuration file
  (using "!include menu.h").
 Ref: menu 5
+
+Tag: possible-documentation-but-no-doc-base-registration
+Severity: wishlist
+Certainty: possible
+Info: The package ships a <tt>.html</tt> or <tt>.pdf</tt> file under
+ <tt>/usr/share/doc/</tt>, which are usually documentation, but it does
+ not register anything in doc-base.
+Ref: policy 9.10
diff --git a/t/tests/menus-doc-base-registration/debian/debian/control.in b/t/tests/menus-doc-base-registration/debian/debian/control.in
new file mode 100644
index 0000000..9664fc6
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/debian/debian/control.in
@@ -0,0 +1,22 @@
+Source: {$srcpkg}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: debhelper (>= 7)
+
+Package: {$srcpkg}-pdf
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} -- pdf doc
+ This is a test package with fake pdf documentation designed to exercise
+ some feature or tag of Lintian.  It is part of the Lintian test suite and
+ may do very odd things.  It should not be installed like a regular package.
+
+Package: {$srcpkg}-html
+Architecture: {$architecture}
+Depends: $\{shlibs:Depends\}, $\{misc:Depends\}
+Description: {$description} -- html doc
+ This is a test package with fake html documentation designed to exercise
+ some feature or tag of Lintian.  It is part of the Lintian test suite and
+ may do very odd things.  It should not be installed like a regular package.
diff --git a/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-html.docs b/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-html.docs
new file mode 100644
index 0000000..3e1708f
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-html.docs
@@ -0,0 +1 @@
+doc1.html
diff --git a/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-pdf.install b/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-pdf.install
new file mode 100644
index 0000000..c78f14e
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/debian/debian/menus-doc-base-registration-pdf.install
@@ -0,0 +1 @@
+doc2.pdf /usr/share/doc/foo/
diff --git a/t/tests/menus-doc-base-registration/debian/doc1.html b/t/tests/menus-doc-base-registration/debian/doc1.html
new file mode 100644
index 0000000..3b18e51
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/debian/doc1.html
@@ -0,0 +1 @@
+hello world
diff --git a/t/tests/menus-doc-base-registration/debian/doc2.pdf b/t/tests/menus-doc-base-registration/debian/doc2.pdf
new file mode 100644
index 0000000..3b18e51
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/debian/doc2.pdf
@@ -0,0 +1 @@
+hello world
diff --git a/t/tests/menus-doc-base-registration/desc b/t/tests/menus-doc-base-registration/desc
new file mode 100644
index 0000000..4faf631
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/desc
@@ -0,0 +1,5 @@
+Testname: menus-doc-base-registration
+Sequence: 6000
+Version: 1.0
+Description: Test some doc-base registration related tags
+Test-For: possible-documentation-but-no-doc-base-registration
diff --git a/t/tests/menus-doc-base-registration/tags b/t/tests/menus-doc-base-registration/tags
new file mode 100644
index 0000000..e77b04f
--- /dev/null
+++ b/t/tests/menus-doc-base-registration/tags
@@ -0,0 +1,2 @@
+I: menus-doc-base-registration-html: possible-documentation-but-no-doc-base-registration
+I: menus-doc-base-registration-pdf: possible-documentation-but-no-doc-base-registration

-- 
Debian package checker


Reply to: