[Slackbuilds-users] douninst.sh in SBo packages

B Watson yalhcru at gmail.com
Thu Oct 28 18:44:23 UTC 2021


On 10/28/21, Erich Ritz via SlackBuilds-users
<slackbuilds-users at slackbuilds.org> wrote:
>
> The only comments are:
>
> # NOTE: This script is run AFTER package removal, so be careful!
> #       Consider it optional, use if it is really needed.
>
> So not much guidance there on what is allowable by SBo standards.

I dunno if there's been any discussion of 'allowable', I came up
with this:

# 20211015 bkw: I was going to have a douninst.sh that runs
# /usr/bin/install-info --delete /usr/info/xroar.info.gz /usr/info/dir
# but this won't work because removepkg has already deleted
# /usr/info/xroar.info.gz before it runs douninst.sh. And you can't
# use install-info to remove stuff *by name* from /usr/info/dir;
# the info file must actually exist.
# So the script has to manually remove the entry from the info dir,
# and the Emulators section if it's become empty.

if [ -e usr/info/dir ]; then
  # Remove the entry first:
  sed -i '/^\* XRoar:/d' usr/info/dir
  # If the Emulators section is empty now, remove it too:
  if grep -A1 '^Emulators$' usr/info/dir | tail -1 | grep -q '^$'; then
    sed -i '/^Emulators$/,+1d' usr/info/dir
  fi
fi


More information about the SlackBuilds-users mailing list