help / color / mirror / Atom feed
From: Peter Bray <pdb_ml@yahoo.com.au>
To: discuss@mdocml.bsd.lv
Subject: mdocml [CVS_2015_11_08] makewhatis and man commands issues
Date: Sun, 08 Nov 2015 12:38:12 +1100	[thread overview]
Message-ID: <563EA784.9000309@yahoo.com.au> (raw)

[-- 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));

             reply	other threads:[~2015-11-08  1:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-08  1:38 Peter Bray [this message]
2016-05-18 22:55 ` Symbolic Link Managers Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563EA784.9000309@yahoo.com.au \
    --to=pdb_ml@yahoo.com.au \
    --cc=discuss@mdocml.bsd.lv \
    --subject='Re: mdocml [CVS_2015_11_08] makewhatis and man commands issues' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).