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

[lintian] 01/01: Warn about packages that ship non-reproducible Python .doctree files. (Closes: #885327)



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

lamby pushed a commit to branch master
in repository lintian.

commit b9b7f4d95fb3ecf21e2ed175dcfd7eff3980a06b
Author: Chris Lamb <lamby@debian.org>
Date:   Tue Dec 26 09:49:21 2017 +0000

    Warn about packages that ship non-reproducible Python .doctree files. (Closes: #885327)
---
 checks/files.desc                         | 25 +++++++++++++++++++++++++
 checks/files.pm                           |  2 ++
 debian/changelog                          |  2 ++
 t/tests/files-general/debian/debian/rules |  1 +
 t/tests/files-general/desc                |  1 +
 t/tests/files-general/tags                |  1 +
 6 files changed, 32 insertions(+)

diff --git a/checks/files.desc b/checks/files.desc
index aa7e02c..2c1e83a 100644
--- a/checks/files.desc
+++ b/checks/files.desc
@@ -1846,3 +1846,28 @@ Info: The specified pkg-config(1) file is installed to
  For projects that use GNU Autotools, a simple method is moving to a debhelper
  compat level of 9 or higher. In the rare case that this file is architecture
  independent it can be installed to <tt>/usr/share/pkgconfig</tt> instead.
+
+Tag: package-contains-python-doctree-file
+Severity: normal
+Certainty: certain
+Info: This package appears to contain a pickled cache of reStructuredText
+ (*.rst) documentation in a <tt>.doctree</tt> file.
+ .
+ These are not needed to display the documentation correctly and as they can
+ contain absolute build paths can affect the reproducibility of the package.
+ .
+ Either prevent the installation of the <tt>.doctree</tt> file (or parent
+ <tt>doctrees</tt> directory if there is one) or pass the <tt>-d</tt>
+ option to <tt>sphinx-build(1)</tt> to create the caches elsewhere.
+ .
+ For example:
+ .
+   override_dh_auto_build:
+           dh_auto_build
+           PYTHONPATH=. sphinx-build -bman docs/ -d debian/doctrees docs/build/html
+           PYTHONPATH=. sphinx-build -bhtml docs/ -d debian/doctrees docs/build/html
+ .
+   override_dh_auto_clean:
+           dh_auto_clean
+           rm -rf debian/doctrees
+Ref: http://sphinx-doc.org/invocation.html#cmdoption-sphinx-build-d
diff --git a/checks/files.pm b/checks/files.pm
index bebc9f6..e05ec01 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -459,6 +459,8 @@ sub run {
             push(@devhelp_links, $blessed);
         }
 
+        tag 'package-contains-python-doctree-file', $file
+          if $file->basename =~ m/\.doctree$/;
         if ($file->basename eq 'gschemas.compiled') {
             tag 'package-contains-compiled-glib-schema', $file;
         }
diff --git a/debian/changelog b/debian/changelog
index dc08354..1123ae1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,8 @@ lintian (2.5.66) UNRELEASED; urgency=medium
     + [CL] Warn maintainers about packages that ship pkg-config files under
       /usr/lib/pkgconfig as they are unavailable under cross-compilation.
       Thanks to Helmut Grohne for the idea.  (Closes: #885096)
+    + [CL] Warn about packages that ship non-reproducible Python .doctree
+      files.  (Closes: #885327)
   * checks/init.d.{pm,desc}:
     + [CL] Don't emit init.d-script-needs-depends-on-lsb-base if the
       package ships a Systemd service file.  (Closes: #864999)
diff --git a/t/tests/files-general/debian/debian/rules b/t/tests/files-general/debian/debian/rules
index cfd8b62..1954cc9 100755
--- a/t/tests/files-general/debian/debian/rules
+++ b/t/tests/files-general/debian/debian/rules
@@ -28,6 +28,7 @@ override_dh_install:
 	touch $(tmp)/usr/share/fonts/X11/misc/encodings.dir
 	touch $(tmp)/usr/share/fonts/X11/misc/false-positive
 	touch $(tmp)/usr/share/foo/.nfs-fake-tmpfile
+	touch $(tmp)/usr/share/foo/foo.doctree
 	touch $(tmp)/usr/share/glib-2.0/schemas/gschemas.compiled
 	# If the following line gets messed up, it can be
 	# restored with something like:
diff --git a/t/tests/files-general/desc b/t/tests/files-general/desc
index 6bfb646..f514d6d 100644
--- a/t/tests/files-general/desc
+++ b/t/tests/files-general/desc
@@ -29,6 +29,7 @@ Test-For:
  package-contains-mime-cache-file
  package-contains-mimeinfo.cache-file
  package-modifies-ld.so-search-path
+ package-contains-python-doctree-file
  raster-image-in-scalable-directory
  star-file
  stray-directory-in-manpage-directory
diff --git a/t/tests/files-general/tags b/t/tests/files-general/tags
index 87f1e98..72f97b8 100644
--- a/t/tests/files-general/tags
+++ b/t/tests/files-general/tags
@@ -35,5 +35,6 @@ W: files-general: icon-size-and-directory-name-mismatch usr/share/apps/lintian/i
 W: files-general: icon-size-and-directory-name-mismatch usr/share/icons/hicolor/22x22/apps/lintian-16x16.png 16x16
 W: files-general: nfs-temporary-file-in-package usr/share/foo/.nfs-fake-tmpfile
 W: files-general: obsolete-comments-style-in-php-ini etc/php/7.0/mods-available/php-foo.ini
+W: files-general: package-contains-python-doctree-file usr/share/foo/foo.doctree
 W: files-general: raster-image-in-scalable-directory usr/share/icons/hicolor/scalable/apps/lintian-16x16.png
 W: files-general: windows-devel-file-in-package usr/lib/foo/foo.vcproj

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


Reply to: