Package: debhelper
Version: 11.5.3
Severity: normal
Tags: patch

I was building a large package offline using:
  nohup debuild -us -uc >& ../logfile &

Unfortunately the build crashed during dh_installman, with the error
message:

stdin not open for reading!
stdin not open for reading!
dh_installman: man -l --recode UTF-8 ./debian/anki/usr/share/man/man1/anki.1 > 
debian/anki/usr/share/man/man1/anki.1.dh-new returned exit code 2
dh_installman: Aborting due to earlier error

(I was actually building a much larger package, but tested it on this
small one for debugging purposes.)

I have tracked down the problem: it turns out that "man" really
objects to being run without a readable stdin for some reason.  The
attached patch, which is somewhat clunky, fixes this.  A nicer
solution would be to include the following snippet after line 461 of
/usr/share/perl5/Debian/Debhelper/Dh_Lib.pm:

                        if (defined(my $input = $options->{stdin})) {
                                open(STDIN, '<', $input) or error("redirect 
STDIN failed: $!");
                        }

and then to include: stdin => '/dev/null'  in the options list on line
303 of dh_installman.

Best wishes,

   Julian

-- System Information:
Debian Release: buster/sid
  APT prefers stretch
  APT policy: (500, 'stretch'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE=en_GB.utf8 (charmap=UTF-8) (ignored: LC_ALL set 
to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages debhelper depends on:
ii  autotools-dev            20180224.1
ii  dh-autoreconf            19
ii  dh-strip-nondeterminism  0.044-1
ii  dpkg                     1.19.2
ii  dpkg-dev                 1.19.2
ii  dwz                      0.12-2
ii  file                     1:5.34-2
ii  libdpkg-perl             1.19.2
ii  man-db                   2.8.4-3
ii  perl                     5.28.0-3
ii  po-debconf               1.0.20

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  2.201801

-- no debconf information
--- /usr/bin/dh_installman      2018-10-31 21:02:00.000000000 +0000
+++ dh_installman       2018-11-13 19:22:24.069750671 +0000
@@ -272,7 +272,7 @@
 });
 
 # Now utf-8 conversion.
-if (defined `man --version`) {
+if (defined `man --version < /dev/null`) {
        my (@manpages_to_reencode, @issues);
        for my $package (@{$dh{DOPACKAGES}}) {
                next if is_udeb($package);
@@ -300,7 +300,7 @@
                        for my $manpage (@_) {
                                my $manpage_tmp = "${manpage}.dh-new";
                                my $manpage_cmd = ($manpage =~ m{^/}) ? 
$manpage : "./${manpage}";
-                               doit({ stdout => $manpage_tmp }, 'man', '-l', 
'--recode', 'UTF-8', $manpage_cmd);
+                               complex_doit('man', '-l', '--recode', 'UTF-8', 
qq["$manpage_cmd"], '>', qq["$manpage_tmp"], '<', '/dev/null');
                                # recode uncompresses compressed pages
                                my $orig = $manpage;
                                rm_files($orig) if $manpage =~ s/\.(gz|Z)$//;

Reply via email to