#!/bin/sh
#
# emacsen remove script for the gri package
# -
# This script is installed by the Gri package `rules' file to 
#  /usr/lib/emacsen-common/packages/remove/gri
# It is run by Gri package `prerm' which calls 
#  /usr/lib/emacsen-common/emacs-package-remove gri
# The Gri package `prerm' is installed as /var/lib/dpkg/info/gri.prerm

set -e 

flavour=$1

package=gri
ELCDIR=/usr/share/${flavour}/site-lisp/gri-el

if [ ${flavour} != emacs ]
then
    echo remove/${package}: Purging byte-compiled files for flavour ${flavour}
    rm -f ${ELCDIR}/gri-mode.elc
    rm -f ${ELCDIR}/gri-mode.el
    rmdir --ignore-fail-on-non-empty ${ELCDIR}
else
    echo remove/${package}: Ignoring emacsen flavour ${flavour}
fi

exit 0;
