[Slackbuilds-users] RFC: Proposed mandb additions to doinst/douninst template

B. Watson urchlay at slackware.uk
Wed Sep 11 04:42:58 UTC 2024



On Wed, 11 Sep 2024, KB_SBo wrote:

> After lurking around this idea a bit, I'm still having trouble
> understanding why this is needed. Speed? Convenience? Purity of Spirit?

To Fix That Which Is Broken.

For "man -k", "whatis", "apropos" commands to work. Not just "right
after package install", for them to work *reliably* at all.

> Adding mandb to doinst seems to add extra complexity without any
> significant gain.

If you're not in the habit of using "man -k", "apropos", or "whatis",
then for you there isn't any gain at all. But other people have
different usage patterns. Our packages should be general-purpose, not
just "works for me".

If you want to, I guess you could label that as "Purity of Spirit".

> After all, we don't run
>
> # updatedb
>
> on package installation since updates eventually occur in a system cron.

Right. But the daily updatedb cron job reliably finds all files that
have been added since last time it ran.

The daily man-db cron job *doesn't* always pick up the new man pages.
It's not reliable.

Specifically, it won't pick them up if you install a package that was
created before the last time the cron job ran.

Reason being, the timestamps on the /usr/man/man* directories get
reset to the timestamps from the package tarball. Then when the cron
job runs, it sees that the timestamps are older than the timestamps of
the databases, so it assumes it doesn't need to do anything.

Other Linux distrubutions have the same problem. Debian deals with it
by having the package installer (dpkg) automatically update the man
database. We don't get to change Slackware's installpkg, so the same
solution can't be used there. So, doing it in doinst.sh is the best I
could come up with.

> Also, I've never experienced any issues accessing a manpage immediately
> after package installation, i.e., no updates to mandb.

Accessing the man page ("man whatever") doesn't use the database. It's
-k option (or apropos, or whatis) that uses the database. In other
words, the database is used for searches.

If it was just a matter of "you have to wait until the daily cronjob
picks them up", I would never have suggested making any changes.

Note that I'm not trying to force anyone to change their existing
builds. I want to add this to the template (for new builds) and as a
"note" (suggestion) in sbolint. It won't be a warning or an error.


More information about the SlackBuilds-users mailing list