[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Man-db-devel] erroneous error message with .pso/.so?
From: |
Alexis Huxley |
Subject: |
[Man-db-devel] erroneous error message with .pso/.so? |
Date: |
Wed, 29 Jul 2015 19:28:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Sorry for posting to the devel list, but I didn't find a more appropriate
forum.
In order to allow some paths mentioned in a man page I've written to be
dynamically defined (depending on user's environment), I've added '-U'
to the arguments of groff and nroff in manpath.config:
chifferi$ grep roff /etc/manpath.config
DEFINE troff groff -U -mandoc
DEFINE nroff nroff -U -mandoc
chifferi$
and this works fine.
Here's a simplified example of what I'm doing:
chifferi$ cat simple-test.1
.pso sh -c 'echo .ds include_dir /home/alexis/experiment/include'
.so \*[include_dir]/simple-test-include.1
.TH SIMPLE\-TEST 1 "Wed Jul 29 18:23:40 CEST 2015"
.SH NAME
simple\-test \- perform a simple test
.br
.ne 5
.SH SYNOPSIS
.B simple\-test
.br
.ne 5
.SH DESCRIPTION
If the next line is '/home/alexis/experiment/include' then .pso directives are
being executed:
.IP
\*[include_dir]
.PP
If the next line says is 'simple test' then .so directives are being executed:
.IP
\*[simple_test_macro]
chifferi$
and:
chifferi$ cat include/simple-test-include.1
.eo
.de simple_test_macro
.nop simple test
..
.ec
chifferi$
and man'ing it works as expected:
SIMPLE-TEST(1) SIMPLE-TEST(1)
NAME
simple-test - perform a simple test
SYNOPSIS
simple-test
DESCRIPTION
If the next line is '/home/alexis/experiment/include' then .pso
directives are being executed:
/home/alexis/experiment/include
If the next line says is 'simple test' then .so directives are
being executed:
simple test
Wed Jul 29 18:23:40 CEST 2015 SIMPLE-TEST(1)
chifferi$
But now here's the same command with stdout discarded instead of stderr:
chifferi$ man ./simple-test.1 >/dev/null
man: can't open \*[include_dir]/simple-test-include.1: No such file or directory
man: -:2: warning: failed .so request
chifferi$
But, as the first output from man indicates, the man command clearly
*is* opening simple-test-include.1. So is the man command erroneously
reporting an error? :-)
On the assumption that man must be calling *roff *twice*, with '-U'
one time and without it the other, I straced it to look for the *roff
calls:
chifferi$ strace -qfe trace=execve man ./simple-test.1 2>&1 | grep roff
[pid 24501] execve("/home/alexis/bin/chifferi/nroff", ["nroff", "-U",
"-mandoc", "-rLL=70n", "-rLT=70n", "-Tascii"], [/* 46 vars */] <unfinished ...>
[pid 24501] execve("/usr/local/bin/nroff", ["nroff", "-U", "-mandoc",
"-rLL=70n", "-rLT=70n", "-Tascii"], [/* 46 vars */] <unfinished ...>
[pid 24501] execve("/usr/bin/nroff", ["nroff", "-U", "-mandoc", "-rLL=70n",
"-rLT=70n", "-Tascii"], [/* 46 vars */]) = 0
[pid 24504] execve("/usr/bin/groff", ["groff", "-mtty-char", "-Tascii", "-U",
"-mandoc", "-rLL=70n", "-rLT=70n"], [/* 47 vars */]) = 0
[pid 24505] execve("/usr/bin/troff", ["troff", "-U", "-mtty-char", "-mandoc",
"-rLL=70n", "-rLT=70n", "-Tascii"], [/* 48 vars */] <unfinished ...>
chifferi$
Running these commands directly (not the first two, which is man
looking in the wrong dirs in $PATH) no error message is displayed.
So what's going on? Any advice appreciated. Thanks.
Alexis
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Man-db-devel] erroneous error message with .pso/.so?,
Alexis Huxley <=