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