On Tue, Jul 25, 2017 at 11:53:45PM +0100, Reuben Thomas wrote:
> On 25 July 2017 at 23:49, Colin Watson <cjwat...@debian.org> wrote:
> > On Tue, Jul 25, 2017 at 11:24:18PM +0100, Reuben Thomas wrote:
> > > I just noticed that man pages installed in ~/.local/share/man are
> > > not found by apropos. This appears to be because there’s no
> > > database for this directory. man finds the directory via the
> > > corresponding ~/.local/bin entry in PATH. It would be nice if
> > > apropos worked too.
> >
> > Have you tried just running mandb as your user?  That should create a
> > suitable database.
> 
> That's great, thanks. However, the beauty of man itself is that it just
> works.
> 
> mandb isn't automatically run when man pages are installed, so it doesn't.

I think it might be worth revisiting the change in man-db 2.4.2-3 to
turn off MAN_DB_CREATES, which means that man doesn't create databases
that doesn't already exist (once the database exists, man should
automatically keep it up to date, although other tools such as apropos
won't necessarily).  I made that change in response to a variety of
bugs, so it can't be simply reverted; but that was way back in 2003
before a great deal of other improvements, so perhaps there are better
ways to address those bugs now.

> > Since a workaround is to use man -K, how about defaulting -k to try
> > > the -K method where no database or whatis file is found?
> >
> > -K searches rather a lot more of the page text than -k does, though, so
> > will often give dramatically different results.
> 
> In this case, it would simply give some results (only being run on
> directories on which otherwise man would give up), which, I submit, is
> better than no results.

Fair, but I think it would be better to fix the problem properly
instead, since man-db does have at least part of the internal tooling
required to do so.

-- 
Colin Watson                                       [cjwat...@debian.org]

Reply via email to