#!/bin/sh -e

FLAVOR="$1"

echo "install/mmm-mode: Handling removal of emacsen flavor ${FLAVOR}"

echo "install/mmm-mode: purging byte-compiled files for ${FLAVOR}"
rm -rf /usr/share/${FLAVOR}/site-lisp/mmm-mode/*.elc

# xemacs has symlinks for the source files, which need to go
# with the exception of cl-lib.el, which is ours
if [ "$FLAVOR" != "emacs" ]; then
    for i in /usr/share/${FLAVOR}/site-lisp/mmm-mode/*; do
        [ -L "$i"  ] && rm -f "$i";
    done
fi

exit 0;
