This file is indexed.

postinst is in dictionaries-common 1.12.1ubuntu2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#! /bin/sh
# postinst script for dictionaries-common

set -e

# Sourcing debconf confmodule
. /usr/share/debconf/confmodule

case "$1" in
  configure)
  # This will remove /usr/share/pspell/region-to-spelling.map diversion by
  # dictionaries-common package and associated stuff if present
    rm -f /var/cache/dictionaries-common/region-to-spelling.map

  # This next handles a bug in some dpkg versions not removing
  # the symlink properly when upgrading
    if [ -L /usr/share/pspell/region-to-spelling.map ]; then
	RTS_DEST=`readlink /usr/share/pspell/region-to-spelling.map`
	if [ "$RTS_DEST" = "/var/cache/dictionaries-common/region-to-spelling.map" ]; then
	    rm -f /usr/share/pspell/region-to-spelling.map
	fi
    fi

  # Removing the diversion if it still exists. trued just in case it does not,
  # since grep returns error breaking postinst because of set -e otherwise.
    DC_DIVERT=`dpkg-divert --list dictionaries-common | grep region-to-spelling.map` || true
    if [ "$DC_DIVERT" ]; then
	dpkg-divert --package  dictionaries-common --remove --rename \
	    --divert /usr/share/pspell/region-to-spelling.map.orig \
	    /usr/share/pspell/region-to-spelling.map
    fi

    # We no longer create the /usr/dict symlink

    # This will check for obsolete /etc/dictionary link
    if [ -L /etc/dictionary ]; then
	db_get dictionaries-common/old_wordlist_link
	if [ "$RET" = "true" ]; then
	    rm /etc/dictionary
	fi
    fi

    # Ensure that automatic generation of files is done, such that we always
    # start with a sane environment.
    update-dictcommon-aspell
    update-dictcommon-hunspell
    # Make sure to not enable trigger here nor try setting symlinks.
    update-default-ispell     --dico-postinst
    update-default-wordlist   --dico-postinst

    # Remove ancient /etc/openoffice/dictionary.lst if present
    if [ -f "/etc/openoffice/dictionary.lst" ]; then
      echo "Removing obsolete \"/etc/openoffice/dictionary.lst\"" >&2
      rm -f "/etc/openoffice/dictionary.lst" "/etc/openoffice/dictionary.lst~" "/etc/openoffice/dictionary.lst.old"
      rmdir --ignore-fail-on-non-empty "/etc/openoffice"
    fi

    # Remove obsolete jed startup file
    if [ -f /etc/jed-init.d/50dictionaries-common.sl ] ; then
        echo "Removing obsolete /etc/jed-init.d/50dictionaries-common.sl" >&2
        rm -f /etc/jed-init.d/50dictionaries-common.sl
    fi

    # That made this dir not be removed by dpkg. Remove it if exists, is non
    # empty, and jed-common is not installed
    if [ -d /etc/jed-init.d ] && [ ! -e /etc/jed-init.d/00debian.sl ]; then
	    rmdir --ignore-fail-on-non-empty /etc/jed-init.d
    fi

    # ---------------- 8< ----------------------------------------------------
    # Remove obsolete dictionaries-common.reconfiguring. This problem only
    # lasted for two days and, so this should go away long before releasing lenny
    if [ -f /var/cache/dictionaries-common/postinst.reconfiguring ] ; then
        echo "Removing obsolete /var/cache/dictionaries-common/postinst.reconfiguring" >&2
        rm -f /var/cache/dictionaries-common/postinst.reconfiguring
    fi
    # ---------------- 8< ----------------------------------------------------

    # Remove obsolete aspell-equivs file
    if [ -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el ] ; then
        echo "Removing obsolete /var/cache/dictionaries-common/emacsen-aspell-equivs.el" >&2
        rm -f /var/cache/dictionaries-common/emacsen-aspell-equivs.el
    fi

  ;;
  triggered)
	[ -z "$DICT_COMMON_DEBUG" ] || echo "Triggers list: \"$2\"" >&2
	for trigger in $2; do
	    [ -z "$DICT_COMMON_DEBUG" ] || echo "Running trigger \"$trigger\"" >&2
	    case $trigger in
		aspell-autobuildhash)
		    aspell-autobuildhash --triggered
		    ;;
		ispell-autobuildhash)
		    ispell-autobuildhash --triggered
		    ;;
		update-default-ispell)
		    update-default-ispell --triggered --rebuild
		    ;;
		update-default-wordlist)
		    update-default-wordlist --triggered --rebuild
		    ;;
		*)
		    echo "Unsupported trigger \"$trigger\"" >&2
	    esac
	done
  ;;
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 0
  ;;
esac

# We need to test that there are emacsen installed before calling emacs-package-*
if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
then
    [ -e /var/lib/emacsen-common/installed-flavors ] && /usr/lib/emacsen-common/emacs-package-install dictionaries-common
fi



exit 0

# Local Variables:
#  sh-indentation: 2
# End: