[Slackbuilds-users] douninst.sh in SBo packages
Erich Ritz
erich.public at protonmail.com
Wed Oct 27 15:08:51 UTC 2021
Hello list,
(This question pertains to -current, not 14.2).
I want to ask about allowable/preferred behavior in doinst.sh and douninst.sh.
Motivation: I maintain a package (system76-io-dkms) that makes use of dkms. This allows new kernel modules to be automatically built for new kernel versions without requiring a package rebuild. Obviously these files won't be tracked by pkgtools, but they are tracked by dkms. The desire then is that when removing the package (by removepkg) it calls out to dkms to remove all files.
Hurdles in implementation: removepkg removes all package files before calling douninst.sh, so any configuration files owned by the package won't be available by douninst.sh. This complicates using dkms.
Solution: Lucky for me another user described a simple solution: https://www.linuxquestions.org/questions/slackware-14/how-can-removepkg-be-triggered-to-remove-stuff-placed-by-a-doinst-sh-4175672073/page4.html#post6109767. Create a copy of the dkms configuration file in doinst.sh. This will create a file that is not tracked by pkgtools. Now in douninst.sh use that file to call out to dkms to remove the remaining modules that may have been automatically built, and finally remove that file. The end result is that after calling removepkg no more files remain on the filesystem from the package.
Here is the patch to system76-io-dkms that implements this behavior: https://gitlab.com/ErichRitz/slackbuilds/-/commit/9c48fe02ac32c382fdac871373054865642440f0
Question: is this behavior acceptable for SBo? I would assume so, but so far there is only 1 other package that makes use of douninst.sh (nvidia-legacy390-driver), so I thought it best to ask first.
Erich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20211027/ead776b2/attachment.htm>
More information about the SlackBuilds-users
mailing list