summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog5
-rwxr-xr-xdh_installman13
2 files changed, 17 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 0e2fe896..d6806f4c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
debhelper (12.6.2) UNRELEASED; urgency=medium
+ [ Niels Thykier ]:
+ * dh_installman: Avoid error message when man-db is not unstalled
+ (only occurs in debhelper's own buid as man-db is a mandatory
+ dependency).
+
[ Helmut Grohne ]:
* cmake buildsystem: Fix CMAKE_SYSTEM_PROCESSOR for 32bit arms.
(Closes: #941245)
diff --git a/dh_installman b/dh_installman
index f8de7ace..55a13fa5 100755
--- a/dh_installman
+++ b/dh_installman
@@ -272,7 +272,7 @@ on_items_in_parallel(\@all_packages, sub {
});
# Now utf-8 conversion.
-if (defined(`man --version`)) {
+if (has_man_db_tool('man')) {
my (@manpages_to_reencode, @issues);
for my $package (@{$dh{DOPACKAGES}}) {
next if is_udeb($package);
@@ -359,6 +359,17 @@ sub find_so_man {
}
}
+sub has_man_db_tool {
+ my ($tool) = @_;
+ open(my $old_stderr, '>&', *STDERR) or error("dup(STDERR, tmp_fd): $!");
+ open(*STDERR, '>', '/dev/null') or error("re-open stderr as /dev/null: $!");
+
+ my $res = defined(`$tool --version`);
+ open(*STDERR, '>&', $old_stderr) or error("dup(tmp_fd, STDERR): $!");
+ close($old_stderr);
+ return $res;
+}
+
=head1 SEE ALSO
L<debhelper(7)>