Rev 38 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 38 | Rev 41 | ||
---|---|---|---|
1 | #! /bin/sh |
1 | #! /bin/sh |
2 | # postinst script for pike7.6 |
2 | # postinst script for pike7.8 |
3 | # |
3 | # |
4 | # see: dh_installdeb(1) |
4 | # see: dh_installdeb(1) |
5 | # |
5 | # |
6 | # $Id: pike7.6-core.postinst,v 1.1 2005/11/21 20:21: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.6 |
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="share/pike/site_pike share/pike${PIKE}/site_pike lib/pike/site_pike lib/pike${PIKE}/site_pike include/pike include/pike${PIKE}" |
31 | LOCAL_DIRS="share/pike/site_pike share/pike${PIKE}/site_pike lib/pike/site_pike lib/pike${PIKE}/site_pike include/pike include/pike${PIKE}" |
32 | 32 | ||
33 | case "$1" in |
33 | case "$1" in |
34 | configure) |
34 | configure) |
35 | update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 10 \ |
35 | update-alternatives --install /usr/bin/pike pike /usr/bin/${PIKEBIN} 10 \ |
36 | --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz |
36 | --slave /usr/share/man/man1/pike.1.gz pike.1.gz /usr/share/man/man1/${PIKEBIN}.1.gz |
37 | # |
37 | # |
38 | # If the creation fails, so be it, user might have the filesystem mounted r/o |
38 | # If the creation fails, so be it, user might have the filesystem mounted r/o |
39 | # |
39 | # |
40 | for d in $LOCAL_DIRS; do |
40 | for d in $LOCAL_DIRS; do |
41 | if [ ! -d /usr/local/$d ]; then |
41 | if [ ! -d /usr/local/$d ]; then |
42 | install -d -m 755 -o root -g root /usr/local/$d || true |
42 | install -d -m 755 -o root -g root /usr/local/$d || true |
43 | fi |
43 | fi |
44 | done |
44 | done |
45 | ;; |
45 | ;; |
46 | 46 | ||
47 | abort-upgrade|abort-remove|abort-deconfigure) |
47 | abort-upgrade|abort-remove|abort-deconfigure) |
48 | 48 | ||
49 | ;; |
49 | ;; |
50 | 50 | ||
51 | *) |
51 | *) |
52 | echo "postinst called with unknown argument \`$1'" >&2 |
52 | echo "postinst called with unknown argument \`$1'" >&2 |
53 | exit 1 |
53 | exit 1 |
54 | ;; |
54 | ;; |
55 | esac |
55 | esac |
56 | 56 | ||
57 | # dh_installdeb will replace this with shell code automatically |
57 | # dh_installdeb will replace this with shell code automatically |
58 | # generated by other debhelper scripts. |
58 | # generated by other debhelper scripts. |
59 | 59 | ||
60 | #DEBHELPER# |
60 | #DEBHELPER# |
61 | 61 | ||
62 | exit 0 |
62 | exit 0 |