#!/bin/sh

# Cleanup apt configuration after devuan-baseconf package removal.

# This script is run by the package management system after the devuan-baseconf
# package is removed. This follows Debian policy as documented at 
# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html.

set -e

case "$1" in
    remove)
       if [ -f /etc/apt/preferences.d/devuan-repository ] ; then
          rm -f /etc/apt/preferences.d/devuan-repository
       fi
       if [ -f /etc/apt/preferences.d/avoid-systemd ] ; then
          rm -f /etc/apt/preferences.d/avoid-systemd
       fi

    ;;

    purge)
      if [ -f /etc/apt/sources.list.d/devuan.list ] ; then
         rm -f /etc/apt/sources.list.d/devuan.list
      fi
      # Source debconf library.
      . /usr/share/debconf/confmodule
      db_purge
    ;;

    upgrade|deconfigure)
    ;;

    failed-upgrade)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
