File: postinst

package info (click to toggle)
vm 6.47-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,704 kB
  • ctags: 1,521
  • sloc: lisp: 22,580; makefile: 260; sh: 201
file content (75 lines) | stat: -rw-r--r-- 1,749 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/sh

set -e

case "$1" in
    configure)
        # continue below
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
        exit 0;
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2;
        exit 0;
    ;;
esac

if test -x /usr/bin/update-menus; then update-menus; fi

install-info --section Emacs Emacs --menuentry=VM \
   --description="The VM Mail Reader User's Manual." \
   --quiet /usr/info/vm.info.gz

if [ -x /usr/lib/emacsen-common/emacs-package-install ]; then
    /usr/lib/emacsen-common/emacs-package-install vm
fi

# Take care of older vm-init requirements
# These are the potential places we could find things in
SITE_START="/etc/emacs/site-start.el /usr/lib/emacs/site-lisp/site-start.el"

# The requires line looks like this
REQUIRE='(load "vm-init.el")'

# Ok, lets see what we have here
for i in $SITE_START ; do
    if [ -e $i ]; then
        if [ "`grep vm-init $i`" != "" ]; then
            SITE_FIX="$SITE_FIX $i"
        fi
    fi
done

# See if we may fix things quietly
for i in $SITE_FIX ; do
    grep -v "$REQUIRE" $i > /etc/emacs/`basename $i`.new.$$
    mv /etc/emacs/`basename $i`.new.$$ $i || echo Could not edit $i
done

# These were the problem files
SITE_START="$SITE_FIX"
SITE_FIX=""

# Any mention of vm-init left?
for i in $SITE_START  ; do
    if [ -e $i ]; then
        if [ "`grep vm-init $i`" != "" ]; then
            SITE_FIX="$SITE_FIX $i"
        fi
    fi
done

if [ "$SITE_FIX" != "" ]; then
    echo ""
    echo "The following files mention vm-init.el, even though they shouldnt:"
    echo "  $SITE_FIX "
    echo "please remove the load or require command from these files."
    echo -n "press <return> to proceed:"
    read $input
    echo ""
fi

exit 0