From a8059109f5651d6598133470c93a17e2c91a05d5 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 16 Jul 2015 18:22:03 +0200 Subject: add templates for emacsen-common helper scripts --- emacsen-common/remove | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 emacsen-common/remove (limited to 'emacsen-common/remove') diff --git a/emacsen-common/remove b/emacsen-common/remove new file mode 100644 index 0000000..8abaf36 --- /dev/null +++ b/emacsen-common/remove @@ -0,0 +1,38 @@ +#!/bin/sh +# /usr/lib/emacsen-common/packages/remove/foo +set -e + +PACKAGE=$DPKG_MAINTSCRIPT_PACKAGE +VERSION=$(dpkg-query -Wf '${Version}' $PACKAGE) +UPSTREAM_VERSION=${VERSION%-*} +ELPA_PACKAGE=${PACKAGE#elpa-}-${UPSTREAM_VERSION} + +FLAVOR=$1 +elc_dir=/usr/share/${FLAVOR}/site-lisp/elpa/${ELPA_PACKAGE} + +FLAVOR=$1 +case $FLAVOR in + emacs) + exit 0 + ;; + emacs23) + echo remove/${ELPA_PACKAGE}: Skipping obsolete emacs ${FLAVOUR} + exit 0 + ;; + xemacs*) + echo remove/${ELPA_PACKAGE}: Skipping unsupported emacs ${FLAVOUR} + ;; + *) + echo remove/${ELPA_PACKAGE}: Handling removal of emacsen flavor ${FLAVOR} +esac + +echo emacsen-common: purging byte-compiled files for ${FLAVOR} +rm -f ${elc_dir}/*.elc +rm -f ${elc_dir}/*.el +rm -f ${elc_dir}/Install.log* +if test -e "${elc_dir}" +then + rmdir --ignore-fail-on-non-empty "${elc_dir}" +fi + +exit 0; -- cgit v1.2.3