This file is indexed.

postinst is in kdm 4:4.8.2a-0ubuntu4.

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
#! /bin/sh

set -e

# source debconf library
. /usr/share/debconf/confmodule

# debconf is not a registry, so we only fiddle with the default file if it
# does not exist
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
if [ ! -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
  DEFAULT_DISPLAY_MANAGER=
  if db_get shared/default-x-display-manager; then
    DEFAULT_DISPLAY_MANAGER="$RET"
  fi
  if [ -n "$DEFAULT_DISPLAY_MANAGER" ]; then
    DAEMON_NAME=
    if db_get "$DEFAULT_DISPLAY_MANAGER"/daemon_name; then
      DAEMON_NAME="$RET"
    fi
    if [ ! -n "$DAEMON_NAME" ]; then
      # if we were unable to determine the name of the selected daemon (for
      # instance, if the selected default display manager doesn't provide a
      # daemon_name question), guess
      DAEMON_NAME=$(which "$DEFAULT_DISPLAY_MANAGER" 2>/dev/null || true)
      if [ ! -n "$DAEMON_NAME" ]; then
        echo .
        # FIXME - redo this part uses shell-lib.sh from xfree86
        #warn "unable to determine path to default X display manager" \
        #     "$DEFAULT_DISPLAY_MANAGER; not updating" \
        #     "$DEFAULT_DISPLAY_MANAGER_FILE"
      fi
    fi
    if [ -n "$DAEMON_NAME" ]; then
      # FIXME - redo this part uses shell-lib.sh from xfree86
      #observe "committing change of default X display manager"
      echo "$DAEMON_NAME" > "$DEFAULT_DISPLAY_MANAGER_FILE"
    fi
  fi
fi

# remove the displaced old default display manager file if it exists
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" ]; then
  rm "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
fi

# restarting the daemon may cause output to stdout
db_stop

# don't start kdm if we are upgrading without stopping it
NOSTART=
if [ -e /var/run/kdm.upgrade ]; then
  NOSTART=yes
fi
# or if we're currently in X on the display it attempts to manage by default
for HOST in "" \
            "localhost" \
            "$(hostname 2> /dev/null)" \
            "$(hostname -f 2> /dev/null)"; do
  if echo "$DISPLAY" | grep -q "^$HOST:0.*"; then
    NOSTART=yes
    break
  fi
done
# or if it's already running
if start-stop-daemon --stop --quiet --signal 0 --pid /var/run/kdm.pid --name kdm; then
  NOSTART=yes
fi
# or if the options file says not to
if ! grep -qs ^restart-on-upgrade /etc/kde4/kdm/kdm.options; then
  NOSTART=yes
fi

#Kubuntu 11.10 -> 12.04 upgrade new default theme from upstream, jriddell 2012-01-24
if grep -qs ^Theme=/usr/share/kde4/apps/kdm/themes/horos /etc/kde4/kdm/kdmrc; then
  sed -i s,Theme=/usr/share/kde4/apps/kdm/themes/horos,Theme=/usr/share/kde4/apps/kdm/themes/ariya, /etc/kde4/kdm/kdmrc
fi

case "$1" in

  configure)
    adduser --system --quiet --no-create-home kdm
    if [ -d /var/lib/kdm ]; then
      chown -R kdm /var/lib/kdm
    fi
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
  ;;

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

esac

if [ -n "$NOSTART" ]; then
  exit 0
else
  start kdm || true
fi



exit 0