| 1 |
#!/bin/sh |
| 2 |
# Written by Charles Briscoe-Smith, March-April 1998. Public Domain. |
| 3 |
# Adapted for potool by Marcin Owsiany, August 2003 |
| 4 |
|
| 5 |
# Abort if any command returns an error value |
| 6 |
set -e |
| 7 |
|
| 8 |
# This script is called as the last step of the installation of the |
| 9 |
# package. All the package's files are in place, dpkg has already done |
| 10 |
# its automatic conffile handling, and all the packages we depend of |
| 11 |
# are already fully installed and configured. |
| 12 |
|
| 13 |
register_alternatives() |
| 14 |
{ |
| 15 |
update-alternatives \ |
| 16 |
--install /usr/bin/poedit poedit /usr/bin/potooledit 80 \ |
| 17 |
--slave /usr/share/man/man1/poedit.1.gz poedit.1.gz \ |
| 18 |
/usr/share/man/man1/potooledit.1.gz \ |
| 19 |
--slave /usr/share/man/pl/man1/poedit.1.gz poedit.pl.1.gz \ |
| 20 |
/usr/share/man/pl/man1/potooledit.1.gz |
| 21 |
} |
| 22 |
|
| 23 |
case "$1" in |
| 24 |
configure) |
| 25 |
# Configure this package. If the package must prompt the user for |
| 26 |
# information, do it here. There are three sub-cases. |
| 27 |
|
| 28 |
register_alternatives |
| 29 |
|
| 30 |
if test "${2+set}" != set; then |
| 31 |
# We're being installed by an ancient dpkg which doesn't remember |
| 32 |
# which version was most recently configured, or even whether |
| 33 |
# there is a most recently configured version. |
| 34 |
: |
| 35 |
elif test -z "$2" -o "$2" = "<unknown>"; then |
| 36 |
# The package has not ever been configured on this system, or was |
| 37 |
# purged since it was last configured. |
| 38 |
: |
| 39 |
else |
| 40 |
# Version $2 is the most recently configured version of this |
| 41 |
# package. |
| 42 |
: |
| 43 |
fi ;; |
| 44 |
abort-upgrade) |
| 45 |
# Back out of an attempt to upgrade this package FROM THIS VERSION |
| 46 |
# to version $2. Undo the effects of "prerm upgrade $2". |
| 47 |
|
| 48 |
register_alternatives |
| 49 |
|
| 50 |
;; |
| 51 |
abort-remove) |
| 52 |
if test "$2" != in-favour; then |
| 53 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 54 |
exit 1 |
| 55 |
fi |
| 56 |
# Back out of an attempt to remove this package, which was due to |
| 57 |
# a conflict with package $3 (version $4). Undo the effects of |
| 58 |
# "prerm remove in-favour $3 $4". |
| 59 |
|
| 60 |
register_alternatives |
| 61 |
|
| 62 |
;; |
| 63 |
abort-deconfigure) |
| 64 |
if test "$2" != in-favour -o "$5" != removing; then |
| 65 |
echo "$0: undocumented call to \`postinst $*'" 1>&2 |
| 66 |
exit 1 |
| 67 |
fi |
| 68 |
# Back out of an attempt to deconfigure this package, which was |
| 69 |
# due to package $6 (version $7) which we depend on being removed |
| 70 |
# to make way for package $3 (version $4). Undo the effects of |
| 71 |
# "prerm deconfigure in-favour $3 $4 removing $6 $7". |
| 72 |
|
| 73 |
register_alternatives |
| 74 |
|
| 75 |
;; |
| 76 |
*) echo "$0: didn't understand being called with \`$1'" 1>&2 |
| 77 |
exit 1;; |
| 78 |
esac |
| 79 |
|
| 80 |
#DEBHELPER# |
| 81 |
|
| 82 |
exit 0 |
| 83 |
|