[Slackbuilds-users] RFC: Proposed mandb additions to doinst/douninst template
B. Watson
urchlay at slackware.uk
Sat Sep 7 21:40:19 UTC 2024
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...
> 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...
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.
More information about the SlackBuilds-users
mailing list