Bug#775053: debbugs: postinst uses /usr/share/doc content (Policy 12.3): /usr/share/doc/debbugs/examples/config

Vagrant Cascadian <[email protected]>
Newsgroups gmane.linux.debian.devel.debbugs
Message-ID <[email protected]>
Control: tags -1 +patch

On 2015-01-10, Andreas Beckmann wrote:
> a test with piuparts revealed that your package uses files from
> /usr/share/doc in its maintainer scripts which is a violation of
> Policy 12.3: "Packages must not require the existence of any files in
> /usr/share/doc/ in order to function."
...
>   Setting up debbugs (2.4.1) ...
>   cp: cannot stat '/usr/share/doc/debbugs/examples/config': No such file or directory
>   No such file or directory at /usr/sbin/debbugsconfig line 75.
>   dpkg: error processing package debbugs (--configure):
>    subprocess installed post-installation script returned error exit status 2
>   Errors were encountered while processing:
>    debbugs

I think the following patch will fix the issue, although I haven't
tested with piuparts, or tested the built package works, but it does
successfully install.

On fresh installs, /usr/share/doc/debbugs/examples is a symlink to
/usr/share/debbugs/examples, but on upgrades, it doesn't handle the
examples directory transforming to a symlink and leaves an empty
directory in /usr/share/doc/debbugs/examples.


diff -Nru debbugs-2.4.1/debian/debbugsconfig debbugs-2.4.1+nmu2/debian/debbugsconfig
--- debbugs-2.4.1/debian/debbugsconfig	2002-11-25 04:34:56.000000000 -0800
+++ debbugs-2.4.1+nmu2/debian/debbugsconfig	2015-01-17 17:33:41.000000000 -0800
@@ -72,7 +72,7 @@
 sub template {
   my ($name, $destdir) = @_;
   if (! -f "$destdir/$name") {
-  system("cp /usr/share/doc/debbugs/examples/$name $destdir/$name") == 0 ||
+  system("cp /usr/share/debbugs/examples/$name $destdir/$name") == 0 ||
 	die "$!";
   print "created $destdir/$name from template.\n";
   }
diff -Nru debbugs-2.4.1/debian/dirs debbugs-2.4.1+nmu2/debian/dirs
--- debbugs-2.4.1/debian/dirs	2002-11-17 09:09:40.000000000 -0800
+++ debbugs-2.4.1+nmu2/debian/dirs	2015-01-17 17:37:08.000000000 -0800
@@ -2,7 +2,7 @@
 etc/debbugs/indices
 usr/lib/debbugs
 usr/sbin
-usr/share/doc/debbugs/examples
+usr/share/debbugs/examples
 var/lib/debbugs/indices
 var/lib/debbugs/www/cgi
 var/lib/debbugs/www/db
diff -Nru debbugs-2.4.1/debian/rules debbugs-2.4.1+nmu2/debian/rules
--- debbugs-2.4.1/debian/rules	2002-11-25 04:25:05.000000000 -0800
+++ debbugs-2.4.1+nmu2/debian/rules	2015-01-17 17:48:19.000000000 -0800
@@ -28,6 +28,7 @@
 	$(MAKE) install_mostfiles DESTDIR=$(tmp_dir)
 	dh_installdocs
 	dh_installchangelogs
+	dh_link usr/share/debbugs/examples usr/share/doc/debbugs/examples
 	dh_strip
 	dh_compress -X examples/text
 	dh_fixperms
diff -Nru debbugs-2.4.1/Makefile debbugs-2.4.1+nmu2/Makefile
--- debbugs-2.4.1/Makefile	2002-11-25 04:25:05.000000000 -0800
+++ debbugs-2.4.1+nmu2/Makefile	2015-01-17 17:33:38.000000000 -0800
@@ -8,7 +8,7 @@
 doc_dir		:= $(DESTDIR)/usr/share/doc/debbugs
 man_dir		:= $(DESTDIR)/usr/share/man
 man8_dir	:= $(man_dir)/man8
-examples_dir	:= $(doc_dir)/examples
+examples_dir	:= $(DESTDIR)/usr/share/debbugs/examples
 
 scripts_in	:= $(filter-out scripts/config.in scripts/errorlib.in scripts/text.in, $(wildcard scripts/*.in))
 htmls_in	:= $(wildcard html/*.html.in)


That said, debbugs hasn't seen an upload to unstable since 2003, and the
upload in experimental was in 2010 (the patch should apply to git
without many changes)... maybe it shouldn't ship with Jessie?


live well,
  vagrant
signature.asc (application/pgp-signature, 818 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJUuxacAAoJELeLgtSBS5G2rSAQAJKL/062CkbhG79e+F2D98Pd
esev6mjGRRcbF294YxpwBl8J4x18vRUgEDsLzIUTzC8w3ZIK8V6XrPp0EHLDDUta
RNab0P9+nWkcZwmDzE6rYseXiAr9ZS9X4GlcAfFvWSdSSIJzr5vRMHwxsXnT/9Cm
/4bmcYdcZc5qjyuQHMoM/9BSnJpS1bFySU0qJBMp/o7vrlgJBAQrPeGf+EzBScJr
IqpVbN3z7siA2COrzP1GSSX2D2l3EOwuyBVBxLMsEhyKkE4HAnedS2R8Jo0E+nXL
2czv5tNb6ZLme9sig12lUr4yS1IShzjutW7YCLTHm3d8Mir9Vn+NZTmUUTAkKeDE
7SEMU5IYCUxCq8ch9/BaUJEtKbRhWKJOcO+uGpbD0tYBC40ut1fduiPr24O0e26b
G+In4pt2ocuavgKlZIiKotcw1m7fjkyOqCzqH2m6B7NWQvsmnVB+Oh53EZZsFIfD
NrDCWmkVw27Cn1d45mX/ZDeNh2YGucz2d6W1V7+76FX3XYvcDZlsrJl+VdQ3ko73
O8HzrZPT6udB3BuUkdZrar9+JgXjcxjOh0eXGHxnF9/UmoT/apa46qnVoV0BfYVJ
4ij2YTRB92ICmudnUCYLVUdPlrOb7B0uptR+tZQr0i05AF9FmokRd5rxUtCXFFMY
dAJXK8etLJMNvaql8Lgu
=GUHm
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.