File: xdm.config.in

package info (click to toggle)
gdm 2.16.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 20,756 kB
  • ctags: 2,870
  • sloc: ansic: 46,434; xml: 17,760; sh: 13,465; makefile: 1,040; perl: 30
file content (82 lines) | stat: -rw-r--r-- 2,388 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# Debian xdm package configuration script
# Copyright 2000-2003 Branden Robinson.
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.

# $Id: xdm.config.in 189 2005-06-11 00:04:27Z branden $

set -e

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

THIS_PACKAGE=xdm
THIS_SCRIPT=config

#INCLUDE_SHELL_LIB#

# set default display manager
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager

OWNERS=
if db_metaget shared/default-x-display-manager owners; then
  OWNERS="$RET"
fi

CHOICES=
if db_metaget shared/default-x-display-manager choices; then
  CHOICES="$RET"
fi

if [ "$OWNERS" != "$CHOICES" ]; then
  observe "X display managers now available are \"$OWNERS\""
  run db_subst shared/default-x-display-manager choices "$OWNERS"
  run db_fset shared/default-x-display-manager seen false
fi

# debconf is not a registry; use the current contents of the default display
# manager file to pre-answer the question if possible
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
  CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
                                "$DEFAULT_DISPLAY_MANAGER_FILE" |
                                head -n 1)")
  if [ -n "$CURRENT_DEFAULT" ]; then
    if ! which "$CURRENT_DEFAULT" >/dev/null 2>&1; then
      observe "default display manager \"$CURRENT_DEFAULT\" specified in" \
              "$DEFAULT_DISPLAY_MANAGER_FILE does not exist or is not" \
              "executable"
    fi
    run db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
  fi
else
  CURRENT_DEFAULT=
  if db_get shared/default-x-display-manager; then
    CURRENT_DEFAULT="$RET"
  fi
fi

run db_input high shared/default-x-display-manager
run db_go

# using this display manager?
NEW_DEFAULT=
if db_get shared/default-x-display-manager; then
  NEW_DEFAULT="$RET"
fi

# move the default display manager file if we're going to change it
if [ -n "$NEW_DEFAULT" ]; then
  if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then
    if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
      observe "preparing to change default X display manager from" \
              "\"$CURRENT_DEFAULT\" to \"$NEW_DEFAULT\""
      mv "$DEFAULT_DISPLAY_MANAGER_FILE" \
         "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
    fi
  fi
fi

exit 0

# vim:set ai et sts=2 sw=2 tw=80: