#!/bin/sh
# vim:set fileencoding=utf-8 et ts=4 sts=4 sw=4:

set -e

hook=/etc/apt/apt.conf.d/20listchanges

if [ "$1" = "remove" ]; then
    test -e $hook && mv $hook $hook.disabled
fi

if [ "$1" = "purge" ]; then
    rm -f $hook.disabled

    dbfile=/var/lib/apt/listchanges
    rm -f ${dbfile}.db ${dbfile}-old.db ${dbfile}-new.db

    if which ucf > /dev/null 2>&1; then
        ucf -p /etc/apt/listchanges.conf
    fi
    rm -f /etc/apt/listchanges.conf
fi

#DEBHELPER#

exit 0
