help / color / mirror / Atom feed
* mdocml [CVS_2015_11_08] makewhatis and man commands issues
@ 2015-11-08  1:38 Peter Bray
  2016-05-18 22:55 ` Symbolic Link Managers Ingo Schwarze
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Bray @ 2015-11-08  1:38 UTC (permalink / raw)
  To: discuss

[-- Attachment #1: Type: text/plain, Size: 3774 bytes --]


After installing mdocml commands with a prefix of "mandoc_", running
'mandoc_man mandoc' gives an error about an out-of-date whatis
database. The error asks the user (administrator) to run 'makewhatis',
as can be seen in this fragment of code:

614 #if HAVE_SQLITE3
615         warnx("outdated mandoc.db lacks %s(%s) entry, run makewhatis 
616             name, sec, paths->paths[ipath]);
617 #endif

IMHO, the code should not be hard coding that name, but using the
cpp(1) macro defined in config.h BINM_MAKEWHATIS. Patch Attached.

Moving on...

I had initial written: "mdocml's makewhatis(8) does not support
Symbolic Link Managers, such as graft [my case], stow, depot."

But than on looking at the code, found that that Symbolic Link
Managers are handled and that its via the support for OSX's homebrew.
And found the Homebrew section in 'configure.local.example', which I
had skipped on the initial reading as I'm not on OSX thus not using

Could I humbly suggest that the wording in 'configure.local.example'
be generalized to include all Symbolic Link Managers and maybe the
control variable (HOMEBREWDIR) be given a more generic name. (It's
only a suggestion, as the code does seem to symlinks correctly after
that configuration change).

Moving on...

The following is the default behavior of the just installed
'mandoc_man', with no 'man.conf' configuration file in place, but with
whatis databases in place:

% env | egrep 'more|less|PAGER|MORE|LESS'

% mandoc_man mandoc
warning /tmp/man.XXXXctaO_A 339
fragment /tmp/man.XXXXctaO_A 171
\&Dt /tmp/man.XXXXctaO_A 910
style /tmp/man.XXXXctaO_A 190
I /tmp/man.XXXXctaO_A 29
\&An /tmp/man.XXXXctaO_A 907
K /tmp/man.XXXXctaO_A 35
\&OP /tmp/man.XXXXctaO_A 909
O /tmp/man.XXXXctaO_A 62
mparse_reset /tmp/man.XXXXctaO_A 1065
MANPAGER /tmp/man.XXXXctaO_A 257
\&Fo /tmp/man.XXXXctaO_A 906
man_node /tmp/man.XXXXctaO_A 1063
T /tmp/man.XXXXctaO_A 65
iso-8859-1 /tmp/man.XXXXctaO_A 51
\&RE /tmp/man.XXXXctaO_A 908
W /tmp/man.XXXXctaO_A 69
\&TH /tmp/man.XXXXctaO_A 911
indent /tmp/man.XXXXctaO_A 148
paper /tmp/man.XXXXctaO_A 227
mparse_alloc /tmp/man.XXXXctaO_A 1055
unsupp /tmp/man.XXXXctaO_A 321
a /tmp/man.XXXXctaO_A 18
mparse_free /tmp/man.XXXXctaO_A 1065
c /tmp/man.XXXXctaO_A 22
f /tmp/man.XXXXctaO_A 26
includes /tmp/man.XXXXctaO_A 177
h /tmp/man.XXXXctaO_A 33
k /tmp/man.XXXXctaO_A 53
l /tmp/man.XXXXctaO_A 56
m /tmp/man.XXXXctaO_A 58
error /tmp/man.XXXXctaO_A 325
utf-8 /tmp/man.XXXXctaO_A 40
mdoc_node /tmp/man.XXXXctaO_A 1063
PAGER /tmp/man.XXXXctaO_A 260
width /tmp/man.XXXXctaO_A 154
mparse_result /tmp/man.XXXXctaO_A 1061
man /tmp/man.XXXXctaO_A 183
mparse_readfd /tmp/man.XXXXctaO_A 1059
\&Bd /tmp/man.XXXXctaO_A 912
mparse_open /tmp/man.XXXXctaO_A 1057
MANDOC(1)              General Commands Manual               MANDOC(1)

      mandoc - format and display UNIX manuals

      mandoc [-acfhkl] [-I os=name] [-K encoding] [-mformat] [-O option]


Reading mandoc.1, I found that this use of more(1) matches the -a
option, but the -c option states it is the default.

% mandoc_man -c mandoc          # Plain text, manual page only
% mandoc_man -c mandoc | less   # Bold and Plain text, manual page only
% mandoc_man -c mandoc | more   # Plain text, manual page only

Any of the above creates a properly formatted mandoc manual page
entry. Without investigation it looks like the -a option is the
default and that it is passing the more filenames to more(1) than is
required. Additionally, 'mandoc_man -a mandoc' produces the same
"erroneous" output.

That will have to do for today, I have to get back to my own project.


Peter Bray
Sydney, Australia

[-- Attachment #2: hardcoded-makewhatis-fix.diff --]
[-- Type: text/plain, Size: 446 bytes --]

--- main.c.orig	2015-11-08 00:20:38.661200997 +0000
+++ main.c	2015-11-08 00:21:18.919810590 +0000
@@ -613,6 +613,6 @@
-	warnx("outdated mandoc.db lacks %s(%s) entry, run makewhatis %s",
-	    name, sec, paths->paths[ipath]);
+	warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s",
+	    name, sec, BINM_MAKEWHATIS, paths->paths[ipath]);
 	*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage));

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-18 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-08  1:38 mdocml [CVS_2015_11_08] makewhatis and man commands issues Peter Bray
2016-05-18 22:55 ` Symbolic Link Managers Ingo Schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).