[Slackbuilds-users] RFC: Proposed mandb additions to doinst/douninst template
Arkadiusz Drabczyk
arkadiusz at drabczyk.org
Sun Sep 8 17:27:40 UTC 2024
On Sat, Sep 07, 2024 at 05:40:19PM -0400, B. Watson wrote:
>
>
> On Sat, 7 Sep 2024, Arkadiusz Drabczyk wrote:
>
> > Out of curiosity I checked how Debian is managing manpages because I
> > remember "Processing triggers for man-db" being printed every time a
> > package is installed and I verified that man -k works immediately
> > after the package is installed:
>
> This is good research.
>
> > But there is still an issue here as man -k lists manpages even after
> > package has been removed due to -p option used with mandb:
> >
> > ja at debian:~$ sudo apt-get -y remove offlineimap3
> ...
> > ja at debian:~$ man -k offlineimap
> > offlineimap (1) - Synchronize mailboxes and Maildirs both ways or one either way.
> > offlineimapui (7) - The User Interfaces
> >
> > Apparently it's a known issue
> > https://bugs-devel.debian.org/cgi-bin/bugreport.cgi?bug=539221#10. So
> > if man database was refreshed on package removal Slackware would be
> > better than Debian :D.
>
> I'm assuming that Debian's got a daily cron job like Slackware
> does, that will remove the removed man pages from the database,
> eventually...
Yes, there is /etc/cron.weekly/man-db which does that.
> > Coming back to the proposal, since running mandb with each manpage is
> > the only viable option to achieve the goal on Slackware (apart from
> > rolling our custom tar extractor as Debian developers did) could we
> > have something that could automate creating the doinst.sh? For
> > example, sbopkglint could try finding all manpages in the package and
> > suggest a bunch of lines that could be pasted verbatim into
> > doinst.sh. I find the current method very daunting as I said in my
> > previous e-mail. We could use system/openGLRefToMan to test the new
> > approach as its install script already calls mandb -c and installs a
> > lot of manpages.
>
> I could make sbopkglint do that.
>
> Sample output might look like:
>
> ___note: package's man pages not added to man database. suggest adding
> this code to your doinst.sh:
>
> if [ -x usr/bin/mandb ]; then
> chroot . /usr/bin/mandb -f /usr/man/man1/blah.1.gz &> /dev/null
> fi
>
> ...with one mandb -f command per man page in the package. Not sure if
> this should include symlinks (does it even matter?).
>
> I wish the chroot weren't necessary, but mandb -f won't work if I
> give it a relative path, and it's incorrect to give an absolute path
> without chroot, because the package might not be getting installed to
> the real root...
Yeah I get the same behavior on -current and on Debian, this must be
the intended behavior of mandb. Anyway, sounds good but why should we
hide errors from the user? And it's a bit worrying that mandb manpage
says that -f 'is not for general use', I hope they'll not remove it
someday.
> I'm not so sure that rebuilding the man database in the douninst.sh
> script is worth the overhead it creates. It's just wasted time, if
> you're upgrading a package and the new version has the same man pages
> as the previous version... and in any case, the daily cronjob will
> remove them from the db.
>
> Of course, not everyone leaves their machines running overnight
> (laptops for instance). But we have anacron in the repo, for just that
> sort of situation.
ok, so we can behave like Debian and run mandb only in doinst.sh.
Another interesting thing is that mandb manpage says that the database
cache should be in /var/cache/man/index.(bt|db|dir|pag) - and indeed
/var/cache/man/index.db exists on Debian but on Slackware
/etc/man_db.conf has been modified in
https://git.slackware.nl/current/commit/?id=646a5c1cbfd95873950a87b5f75d52073a967023
and the database is in /var/cache/man/usr-man/index.db - does anybody
why it was changed?
--
Arkadiusz Drabczyk <arkadiusz at drabczyk.org>
More information about the SlackBuilds-users
mailing list