File: emacsen-remove

package info (click to toggle)
tdtd 0.7.1-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 200 kB
  • ctags: 154
  • sloc: lisp: 1,944; sh: 78; makefile: 42
file content (50 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download
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
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
#
# emacsen-remove for tdtd, Adam Di Carlo <aph@debian.org>
#
# parts borrowed from gnus's emacsen-install,
#  by Manoj Srivastava <srivasta@tiamat.datasync.com>
#
# This file is free software under the terms of the GNU
# Public License, version 2 or higher.

set -e

FLAVOR=$1
PACKAGE=tdtd

if [ -z "$FLAVOR" ]; then
    echo need argument to determine FLAVOR of emacs
    exit 1
fi

if [ -z "$PACKAGE" ]; then
    echo internal error: need package name
    exit 1
fi

ELDIR=/usr/share/emacs/site-lisp/$PACKAGE
ELCDIR=/usr/share/$FLAVOR/site-lisp/$PACKAGE
STARTFILE=/etc/$FLAVOR/site-start.d/50$PACKAGE.el

case "$FLAVOR" in
    emacs20 | xemacs21 | mule2 | emacs21)
	echo -n "remove/$PACKAGE: removing for $FLAVOR..."
	if [ -d $ELCDIR ]; then
	    rm -rf $ELCDIR
        else
            echo
            echo -n "warning: no dir $ELCDIR, continuing..."
	fi
	if [ -L $STARTFILE ]; then
	    rm -f $STARTFILE
	fi

	echo "done."
	;;
    *)
	echo "remove/$PACKAGE: ignoring emacsen flavor $FLAVOR."
	;;
esac

exit 0