Source: collectd
Version: 5.2.1-1
Severity: normal
User: [email protected]
Usertags: perl-5.18-transition

pod2man from perl 5.18 now exits with a non-zero exit code rather than
putting errors in the manpage (see [1]). Unfortunately. src/Makefile.am
assumes the latter behaviour, and masks non-zero exit codes:

.pod.1:
    pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
        >.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
    @if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
    then \
        echo "$@ has some POD errors!"; false; \
    fi

Thie manifests in the current package as an odd missing manpage
(collectdctl.1) which doesn't get detected until the install phase of
the package build. Separate bug about that particular case to follow.

Patches along the attached lines should stop these errors from being
ignored, but they also reveal at least one more POD errors to be fixed
For this reason, I'm not tagging this but with 'patch' at the moment.
The patches are against 5.2.1-1 from experimental, as I assume that's
what you are considering your development head at the moment.

Note that I haven't verified the correctness of dh_autoreconf, nor
investigated whether there are any particular reasons to ignore the
exit code of pod2man, but I have verified that this patchset doesn't
break the build with perl 5.14 (sid).

[1] <https://rt.cpan.org/Public/Bug/Display.html?id=39007>

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)
>From 490e6fa071156ff7fa958cf9f6a2e91b1186b8df Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <[email protected]>
Date: Sat, 18 May 2013 01:31:34 +0100
Subject: [PATCH 1/2] Run dh_autoreconf

This is needed to patch src/Makefile.am
---
 debian/control |    3 ++-
 debian/rules   |    1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index c58c2d2..d2f942b 100644
--- a/debian/control
+++ b/debian/control
@@ -42,7 +42,8 @@ Build-Depends: debhelper (>= 5), dpkg-dev (>= 1.14.10), po-debconf, dpatch,
  linux-libc-dev (>= 2.6.25-4) [linux-any] | linux-libc-dev (<< 2.6.25-1) [linux-any],
  openjdk-6-jdk [!hppa !kfreebsd-any !hurd-any],
  protobuf-c-compiler,
- python-dev
+ python-dev,
+ dh-autoreconf
 Build-Conflicts: libpthread-dev
 Standards-Version: 3.9.4
 Homepage: http://collectd.org/
diff --git a/debian/rules b/debian/rules
index af70f20..0a9c424 100755
--- a/debian/rules
+++ b/debian/rules
@@ -168,6 +168,7 @@ config.status: configure $(DPATCH_STAMPFN)
 		/usr/lib/pkgconfig/OpenIPMIpthread.pc \
 		> debian/pkgconfig/OpenIPMIpthread.pc
 	
+	dh_autoreconf
 	PKG_CONFIG_PATH="$(CURDIR)/debian/pkgconfig:$$PKG_CONFIG_PATH" \
 	./configure $(confflags) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
 		JAVAC="$(JAVAC)" JAR="$(JAR)" JAVA_CPPFLAGS="$(JAVA_CPPFLAGS)" \
-- 
1.7.10.4

>From 2eccc17ae0b69e00539bb01adf16a9c208d45e06 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <[email protected]>
Date: Sat, 18 May 2013 01:09:23 +0100
Subject: [PATCH 2/2] Don't ignore non-zero exit codes from pod2man

Perl 5.18 ships wit a version of pod2man which, rather than putting
POD errors into the manpage, displays an error message on STDERR and
exits non-zero. Adapt src/Makefile.am to no longer ignore exit codes
from pod2man, to avoid mysterious missing manpages.
---
 debian/patches/00list             |    1 +
 debian/patches/pod2man_fix.dpatch |   27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100755 debian/patches/pod2man_fix.dpatch

diff --git a/debian/patches/00list b/debian/patches/00list
index 23aacf6..fdc7cf4 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -2,3 +2,4 @@ rrd_filter_path.dpatch
 collection_conf_path.dpatch
 myplugin_includes.dpatch
 bts559801_plugin_find_fix.dpatch
+pod2man_fix.dpatch
diff --git a/debian/patches/pod2man_fix.dpatch b/debian/patches/pod2man_fix.dpatch
new file mode 100755
index 0000000..aefb8c5
--- /dev/null
+++ b/debian/patches/pod2man_fix.dpatch
@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## pod2man_fix.dpatch by Dominic Hargreaves <[email protected]>
+##
+## DP: Don't ignore non-zero exit codes from pod2man
+
+@DPATCH@
+
+--- a/src/Makefile.am.orig	2013-05-18 01:00:49.000000000 +0100
++++ b/src/Makefile.am	2013-05-18 01:01:39.000000000 +0100
+@@ -1355,7 +1355,7 @@
+ 
+ .pod.1:
+ 	pod2man --release=$(VERSION) --center=$(PACKAGE) $< \
+-		>.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
++		>.pod2man.tmp.$$$$ && mv -f .pod2man.tmp.$$$$ $@
+ 	@if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
+ 	then \
+ 		echo "$@ has some POD errors!"; false; \
+@@ -1363,7 +1363,7 @@
+ 
+ .pod.5:
+ 	pod2man --section=5 --release=$(VERSION) --center=$(PACKAGE) $< \
+-		>.pod2man.tmp.$$$$ 2>/dev/null && mv -f .pod2man.tmp.$$$$ $@ || true
++		>.pod2man.tmp.$$$$ && mv -f .pod2man.tmp.$$$$ $@
+ 	@if grep '\<POD ERRORS\>' $@ >/dev/null 2>&1; \
+ 	then \
+ 		echo "$@ has some POD errors!"; false; \
-- 
1.7.10.4

Reply via email to