Rev 198 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 198 | Rev 270 | ||
---|---|---|---|
1 | #! /bin/sh |
1 | #! /bin/sh |
2 | # postinst script for pike8.0 |
2 | # postinst script for pike8.0 |
3 | 3 | ||
4 | set -e |
4 | set -e |
5 | 5 | ||
6 | PIKE=8.0 |
6 | PIKE=8.0 |
7 | PIKEBIN=pike${PIKE} |
7 | PIKEBIN=pike${PIKE} |
8 | 8 | ||
9 | # summary of how this script can be called: |
9 | # summary of how this script can be called: |
10 | # * <postinst> `configure' <most-recently-configured-version> |
10 | # * <postinst> `configure' <most-recently-configured-version> |
11 | # * <old-postinst> `abort-upgrade' <new version> |
11 | # * <old-postinst> `abort-upgrade' <new version> |
12 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
12 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
13 | # <new-version> |
13 | # <new-version> |
14 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
14 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
15 | # <failed-install-package> <version> `removing' |
15 | # <failed-install-package> <version> `removing' |
16 | # <conflicting-package> <version> |
16 | # <conflicting-package> <version> |
17 | # for details, see http://www.debian.org/doc/debian-policy/ or |
17 | # for details, see http://www.debian.org/doc/debian-policy/ or |
18 | # the debian-policy package |
18 | # the debian-policy package |
19 | # |
19 | # |
20 | # quoting from the policy: |
20 | # quoting from the policy: |
21 | # Any necessary prompting should almost always be confined to the |
21 | # Any necessary prompting should almost always be confined to the |
22 | # post-installation script, and should be protected with a conditional |
22 | # post-installation script, and should be protected with a conditional |
23 | # so that unnecessary prompting doesn't happen if a package's |
23 | # so that unnecessary prompting doesn't happen if a package's |
24 | # installation fails and the `postinst' is called with `abort-upgrade', |
24 | # installation fails and the `postinst' is called with `abort-upgrade', |
25 | # `abort-remove' or `abort-deconfigure'. |
25 | # `abort-remove' or `abort-deconfigure'. |
26 | LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include" |
26 | LOCAL_DIRS="lib/pike${PIKE}/modules lib/pike${PIKE}/include" |
27 | 27 | ||
28 | update_modules () { |
28 | update_modules () { |
29 | # Unfortunately we more or less have to delete all .o files and |
29 | # Unfortunately we more or less have to delete all .o files and |
30 | # redump everything, because although master.pike won't use a .o |
30 | # redump everything, because although master.pike won't use a .o |
31 | # file that is older than its corresponding source, modules often |
31 | # file that is older than its corresponding source, modules often |
32 | # contain compile-time conditionals like |
32 | # contain compile-time conditionals like |
33 | # |
33 | # |
34 | # #if constant(Mysql.mysql) |
34 | # #if constant(Mysql.mysql) |
35 | # |
35 | # |
36 | # If the Mysql module is not installed, the code inside that |
36 | # If the Mysql module is not installed, the code inside that |
37 | # conditional block will not be compiled, and the referring module |
37 | # conditional block will not be compiled, and the referring module |
38 | # won't be detected as out-of-date if the Mysql module is later |
38 | # won't be detected as out-of-date if the Mysql module is later |
39 | # installed. |
39 | # installed. |
40 | find /usr/lib/$PIKEBIN -name '*.o' -delete |
40 | find /usr/lib/$PIKEBIN -name '*.o' -delete |
41 | $PIKEBIN -x dump --distquiet -r /usr/lib/$PIKEBIN/modules /usr/lib/$PIKEBIN/?.?/modules |
41 | $PIKEBIN -x dump --distquiet -r /usr/lib/$PIKEBIN/modules /usr/lib/$PIKEBIN/?.?/modules |
42 | } |
42 | } |
43 | 43 | ||
44 | case "$1" in |
44 | case "$1" in |
45 | configure) |
45 | configure) |
46 | update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 14 \ |
46 | update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 14 \ |
47 | --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz |
47 | --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz |
48 | # |
48 | # |
49 | # If the creation fails, so be it, user might have the filesystem mounted r/o |
49 | # If the creation fails, so be it, user might have the filesystem mounted r/o |
50 | # |
50 | # |
51 | for d in $LOCAL_DIRS; do |
51 | for d in $LOCAL_DIRS; do |
52 | if [ ! -d /usr/local/$d ]; then |
52 | if [ ! -d /usr/local/$d ]; then |
53 | install -d -m 755 -o root -g root /usr/local/$d || true |
53 | install -d -m 755 -o root -g root /usr/local/$d || true |
54 | fi |
54 | fi |
55 | done |
55 | done |
56 | 56 | ||
57 | update_modules |
57 | update_modules |
58 | ;; |
58 | ;; |
59 | 59 | ||
60 | abort-upgrade|abort-remove|abort-deconfigure) |
60 | abort-upgrade|abort-remove|abort-deconfigure) |
61 | 61 | ||
62 | ;; |
62 | ;; |
63 | 63 | ||
64 | triggered) |
64 | triggered) |
65 | update_modules |
65 | update_modules |
66 | ;; |
66 | ;; |
67 | 67 | ||
68 | *) |
68 | *) |
69 | echo "postinst called with unknown argument \`$1'" >&2 |
69 | echo "postinst called with unknown argument \`$1'" >&2 |
70 | exit 1 |
70 | exit 1 |
71 | ;; |
71 | ;; |
72 | esac |
72 | esac |
73 | 73 | ||
74 | # dh_installdeb will replace this with shell code automatically |
74 | # dh_installdeb will replace this with shell code automatically |
75 | # generated by other debhelper scripts. |
75 | # generated by other debhelper scripts. |
76 | 76 | ||
77 | #DEBHELPER# |
77 | #DEBHELPER# |
78 | 78 | ||
79 | exit 0 |
79 | exit 0 |