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

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



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

Attachment: signature.asc
Description: PGP signature


Reply to: