Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 92 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 94
1
#! /bin/sh
1
#! /bin/sh
2
# postinst script for pike7.8
2
# postinst script for pike7.8
3
#
3
#
4
# see: dh_installdeb(1)
4
# see: dh_installdeb(1)
5
# 
5
# 
6
# $Id: pike7.8-core.postinst,v 1.1 2006/01/17 22:37:48 grendel Exp $
6
# $Id: pike7.8-core.postinst,v 1.1 2006/01/17 22:37:48 grendel Exp $
7
#
7
#
8
8
9
set -e
9
set -e
10
10
11
PIKE=7.8
11
PIKE=7.8
12
PIKEBIN=pike${PIKE}
12
PIKEBIN=pike${PIKE}
13
13
14
# summary of how this script can be called:
14
# summary of how this script can be called:
15
#        * <postinst> `configure' <most-recently-configured-version>
15
#        * <postinst> `configure' <most-recently-configured-version>
16
#        * <old-postinst> `abort-upgrade' <new version>
16
#        * <old-postinst> `abort-upgrade' <new version>
17
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
17
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
18
#          <new-version>
18
#          <new-version>
19
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
19
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
20
#          <failed-install-package> <version> `removing'
20
#          <failed-install-package> <version> `removing'
21
#          <conflicting-package> <version>
21
#          <conflicting-package> <version>
22
# for details, see http://www.debian.org/doc/debian-policy/ or
22
# for details, see http://www.debian.org/doc/debian-policy/ or
23
# the debian-policy package
23
# the debian-policy package
24
#
24
#
25
# quoting from the policy:
25
# quoting from the policy:
26
#     Any necessary prompting should almost always be confined to the
26
#     Any necessary prompting should almost always be confined to the
27
#     post-installation script, and should be protected with a conditional
27
#     post-installation script, and should be protected with a conditional
28
#     so that unnecessary prompting doesn't happen if a package's
28
#     so that unnecessary prompting doesn't happen if a package's
29
#     installation fails and the `postinst' is called with `abort-upgrade',
29
#     installation fails and the `postinst' is called with `abort-upgrade',
30
#     `abort-remove' or `abort-deconfigure'.
30
#     `abort-remove' or `abort-deconfigure'.
31
LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include"
31
LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include"
32
32
33
update_modules () {
33
update_modules () {
34
    $PIKEBIN -x dump $@ --distquiet -r /usr/lib/$PIKEBIN/modules
-
 
35
    find /usr/lib/$PIKEBIN/modules -name '*.o' | sed 's/.o$//' |
34
    find /usr/lib/$PIKEBIN/modules -name '*.o' | sed 's/.o$//' |
36
    while read f; do 
35
    while read f; do 
37
	if [ ! -f $f ]; then
36
	if [ ! -f $f ]; then
38
	    rm -f $f.o
37
	    rm -f $f.o
39
	fi
38
	fi
40
    done
39
    done
-
 
40
    $PIKEBIN -x dump $@ --distquiet -r /usr/lib/$PIKEBIN/modules
41
}
41
}
42
42
43
case "$1" in
43
case "$1" in
44
    configure)
44
    configure)
45
    update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 12 \
45
    update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 12 \
46
    --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz
46
    --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz
47
    #
47
    #
48
    # If the creation fails, so be it, user might have the filesystem mounted r/o
48
    # If the creation fails, so be it, user might have the filesystem mounted r/o
49
    #
49
    #
50
    for d in $LOCAL_DIRS; do
50
    for d in $LOCAL_DIRS; do
51
        if [ ! -d /usr/local/$d ]; then
51
        if [ ! -d /usr/local/$d ]; then
52
            install -d -m 755 -o root -g root /usr/local/$d || true
52
            install -d -m 755 -o root -g root /usr/local/$d || true
53
        fi
53
        fi
54
    done
54
    done
55
55
56
    update_modules
56
    update_modules
57
    ;;
57
    ;;
58
58
59
    abort-upgrade|abort-remove|abort-deconfigure)
59
    abort-upgrade|abort-remove|abort-deconfigure)
60
60
61
    ;;
61
    ;;
62
62
63
    triggered)
63
    triggered)
64
	update_modules -u
64
	update_modules -u
65
    ;;
65
    ;;
66
66
67
    *)
67
    *)
68
        echo "postinst called with unknown argument \`$1'" >&2
68
        echo "postinst called with unknown argument \`$1'" >&2
69
        exit 1
69
        exit 1
70
    ;;
70
    ;;
71
esac
71
esac
72
72
73
# dh_installdeb will replace this with shell code automatically
73
# dh_installdeb will replace this with shell code automatically
74
# generated by other debhelper scripts.
74
# generated by other debhelper scripts.
75
75
76
#DEBHELPER#
76
#DEBHELPER#
77
77
78
exit 0
78
exit 0