#! /bin/sh
# /usr/lib/emacsen-common/packages/remove/debview
set -e

FLAVOR=$1
echo remove/debview: Handling removal of emacsen flavor ${FLAVOR}

if [ ${FLAVOR} != emacs ]; then
    echo emacsen-common: purging byte-compiled files for ${FLAVOR}
    rm -f /usr/share/${FLAVOR}/site-lisp/debview/deb-view.elc
    rm -f /usr/share/${FLAVOR}/site-lisp/debview/install.log

    # Someone could conceivably have deposited some extra files
    # into the debview directory.  We don't really want to fail
    # in that case, and we don't really want to remove them,
    # either, since they don't belong to us.  So always succeed,
    # whether the directory was removed or not.
    rmdir /usr/share/${FLAVOR}/site-lisp/debview || true
fi
exit 0
