pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[Solved] [Linux] Man pages from pkgsrc don't get cached by native mandb



On Tue, 21 May 2019 at 18:29, Ottavio Caruso
<ottavio2006-usenet2012%yahoo.com@localhost> wrote:
>
> Hi all,
>
> I posted this question on a Linux forum but I got no replies. I'm not
> sure whether the problem is with Linux or pkgsrc, but I hope you can
> help.
>
> Background: on my LMDE 3 Cindy, based on Debian Stretch, I've
> installed pkgsrc as root user. This is the relevant snippet from my
> mk.conf:
>
> PKG_DBDIR=        /opt/pkg/pkgdb
> LOCALBASE=        /opt/pkg
> VARBASE=        /opt/pkg/var
> PKG_TOOLS_BIN=        /opt/pkg/sbin
> PKGINFODIR=        info
> PKGMANDIR=        man
>
> I've added /opt/pkg/bin and /opt/pkg/sbin to $PATH for both standard
> and root user, plus I have added them as secure path in the global
> sudo configuration file.
>
> I didn't need to add /opt/pkg/man to $MANPATH because Debian doesn't
> use $MANPATH anymore. Just running /usr/bin/manpath gives me the
> correct path for both standard and root user:
>
> $ manpath
> /opt/pkg/man:/usr/local/man:/usr/local/share/man:/usr/share/man
>
> Let's say I ask for the man page of pkgin: it works fine.
>
> But if invoke 'whatis' or 'man -f', the man page is not found:
>
> $ man -f pkgin
> pkgin: nothing appropriate.
> $ whatis  pkgin
> pkgin: nothing appropriate.
>
> I've tried to recreate a database using 'mandb' as a standard user,
> but it fails. The relevant bits are (for example):
>
> mandb: warning: cannot create catdir /opt/pkg/man/sr/cat1
> warning: cannot create catdir /opt/pkg/man/sr/cat1
> database /opt/pkg/man/sr/2090 is read-only
> failed to open /opt/pkg/man/pl/2090 O_RDONLY
> create_db(/opt/pkg/man/pl): /opt/pkg/man/pl/2090
> Testing /opt/pkg/man/pl for new files
> creating catdir hierarchy /opt/pkg/man/pl   Processing manual
>     pages under /opt/pkg/man/pl...
>
> Full text:
> https://pastebin.com/raw/eSe96w8R
>
> I don't have write permission on /opt, so I expect this is just  a
> permission problem. I then switched to root user and I rerun the same
> command. No warning issues, and it looks like mandb picks /opt/pkg/man
> as a valid man directory, but no caches are generated:
>
> # grep pkg mand.root.txt
> path directory /opt/pkg/bin is not in the config file
> adding /opt/pkg/man to manpath
> path directory /opt/pkg/sbin is not in the config file
> /opt/pkg/man is already in the manpath
>
> Run as root, 'mandb' understands that there are man pages in
> /opt/pkg/man , but doesn't cache them.
>
> Pastebin:
> https://pastebin.com/raw/8zhkauMw
>
> Short of editing manpath configuration file (/etc/manpath.config), is
> there another way for mandb to generate a cache for /opt/pkg/man?
>
> (I'm not really sure how this would work on a native NetBSD system
> because I don't have one at hand)

Solved (kind of). For those interested and future reference. I have
added this line to /etc/manpath.config:

MANDB_MAP    /opt/pkg/man        /opt/pkg/var/cache/man

And now I have:

$ apropos pkgin
pkgin (1)            - A tool to manage pkgsrc binary packages.
$ whatis pkgin
pkgin (1)            - A tool to manage pkgsrc binary packages.




-- 
Ottavio Caruso


Home | Main Index | Thread Index | Old Index