File: remove

package info (click to toggle)
dh-elpa 1.6
  • links: PTS, VCS
  • area: main
  • in suites: stretch, stretch-backports
  • size: 136 kB
  • sloc: perl: 326; lisp: 232; sh: 70; makefile: 17
file content (38 lines) | stat: -rwxr-xr-x 873 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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}
	exit 0
        ;;
    *)
        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;