diff options
Diffstat (limited to 'emacsen-common/remove')
-rwxr-xr-x | emacsen-common/remove | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/emacsen-common/remove b/emacsen-common/remove new file mode 100755 index 0000000..d09371e --- /dev/null +++ b/emacsen-common/remove @@ -0,0 +1,37 @@ +#!/bin/sh +# /usr/lib/emacsen-common/packages/remove/foo +set -e + +ELPA_DIR=#ELPAPACKAGE#-#ELPAVERSION# + +FLAVOR=$1 +elpa_root="/usr/share/${FLAVOR}/site-lisp/elpa" +elc_dir="${elpa_root}/${ELPA_DIR}" + +FLAVOR=$1 +case $FLAVOR in + emacs) + exit 0 + ;; + emacs2[0123]*) + echo remove/${ELPA_DIR}: Skipping obsolete emacs ${FLAVOUR} + exit 0 + ;; + xemacs*) + echo remove/${ELPA_DIR}: Skipping unsupported emacs ${FLAVOUR} + ;; + *) + echo remove/${ELPA_DIR}: Handling removal of emacsen flavor ${FLAVOR} +esac + +echo dh-elpa: purging flavor specific files for ${FLAVOR} +rm -f ${elc_dir}/*.elc +[ -d ${elc_dir} ] && find ${elc_dir} -type l -delete +rm -f ${elc_dir}/Install.log* +if test -e "${elc_dir}" +then + rmdir --ignore-fail-on-non-empty "${elc_dir}" + rmdir --ignore-fail-on-non-empty "${elpa_root}" +fi + +exit 0; |