#!/bin/sh -e

if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
    . /usr/share/debconf/confmodule
    db_purge
    rm -rf /var/cache/localepurge
    rm -f /etc/locale.nopurge
    if [ -x /usr/bin/ucf ]; then
        /usr/bin/ucf --debconf-ok --purge /etc/locale.nopurge
    else
        echo >&2 "/etc/locale.nopurge could not be purged because ucf was not found."
    fi
    if [ -x /usr/bin/ucfr ]; then
        /usr/bin/ucfr --purge localepurge /etc/locale.nopurge
    fi
    rm -f /etc/locale.nopurge.md5sum

echo
echo "  To reinstall all the packages which localepurge has been taking care"
echo "  of before, you can use the following command:"
echo
echo "    apt-get -u --reinstall --fix-missing install \$(dpkg -S LC_MESSAGES | cut -d: -f1 | tr ', ' '\n' | sort -u)"
echo
fi

#DEBHELPER#
