| 1 |
trigger-guest |
7237 |
#!/bin/sh |
| 2 |
|
|
# Debian kdm package configuration script |
| 3 |
|
|
# stolen from the xdm scripts |
| 4 |
|
|
# Copyright 2000--2003 Branden Robinson. |
| 5 |
|
|
# Licensed under the GNU General Public License, version 2. See the file |
| 6 |
|
|
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>. |
| 7 |
|
|
|
| 8 |
|
|
set -e |
| 9 |
|
|
|
| 10 |
|
|
# source debconf library |
| 11 |
|
|
. /usr/share/debconf/confmodule |
| 12 |
|
|
|
| 13 |
|
|
THIS_PACKAGE=kdm |
| 14 |
|
|
|
| 15 |
|
|
# set default display manager |
| 16 |
|
|
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager |
| 17 |
|
|
|
| 18 |
|
|
OWNERS= |
| 19 |
|
|
if db_metaget shared/default-x-display-manager owners; then |
| 20 |
|
|
OWNERS="$RET" |
| 21 |
|
|
fi |
| 22 |
|
|
|
| 23 |
|
|
CHOICES= |
| 24 |
|
|
if db_metaget shared/default-x-display-manager choices; then |
| 25 |
|
|
CHOICES="$RET" |
| 26 |
|
|
fi |
| 27 |
|
|
|
| 28 |
|
|
if [ "$OWNERS" != "$CHOICES" ]; then |
| 29 |
|
|
# FIXME - redo this part uses shell-lib.sh from xfree86 |
| 30 |
|
|
# observe "X display managers now available are \"$OWNERS\"" |
| 31 |
|
|
db_subst shared/default-x-display-manager choices "$OWNERS" |
| 32 |
|
|
db_fset shared/default-x-display-manager seen false |
| 33 |
|
|
fi |
| 34 |
|
|
|
| 35 |
|
|
# debconf is not a registry; use the current contents of the default display |
| 36 |
|
|
# manager file to pre-answer the question if possible |
| 37 |
|
|
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then |
| 38 |
|
|
CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \ |
| 39 |
|
|
"$DEFAULT_DISPLAY_MANAGER_FILE" | |
| 40 |
|
|
head -n 1)") |
| 41 |
|
|
if [ -n "$CURRENT_DEFAULT" ]; then |
| 42 |
|
|
if ! which "$CURRENT_DEFAULT" > /dev/null 2>&1; then |
| 43 |
|
|
echo . |
| 44 |
|
|
# FIXME - redo this part uses shell-lib.sh from xfree86 |
| 45 |
|
|
#observe "default display manager \"$CURRENT_DEFAULT\" specified in" \ |
| 46 |
|
|
# "$DEFAULT_DISPLAY_MANAGER_FILE does not exist or is not" \ |
| 47 |
|
|
# "executable" |
| 48 |
|
|
fi |
| 49 |
|
|
db_set shared/default-x-display-manager "$CURRENT_DEFAULT" |
| 50 |
|
|
fi |
| 51 |
|
|
else |
| 52 |
|
|
CURRENT_DEFAULT= |
| 53 |
|
|
if db_get shared/default-x-display-manager; then |
| 54 |
|
|
CURRENT_DEFAULT="$RET" |
| 55 |
|
|
fi |
| 56 |
|
|
fi |
| 57 |
|
|
|
| 58 |
|
|
db_input high shared/default-x-display-manager || true |
| 59 |
|
|
db_go |
| 60 |
|
|
|
| 61 |
|
|
# using this display manager? |
| 62 |
|
|
NEW_DEFAULT= |
| 63 |
|
|
if db_get shared/default-x-display-manager; then |
| 64 |
|
|
NEW_DEFAULT="$RET" |
| 65 |
|
|
fi |
| 66 |
|
|
|
| 67 |
|
|
# move the default display manager file if we're going to change it |
| 68 |
|
|
if [ -n "$NEW_DEFAULT" ]; then |
| 69 |
|
|
if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then |
| 70 |
|
|
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then |
| 71 |
|
|
# FIXME - redo this part uses shell-lib.sh from xfree86 |
| 72 |
|
|
# observe "preparing to change default X display manager from" \ |
| 73 |
|
|
# "\"$CURRENT_DEFAULT\" to \"$NEW_DEFAULT\"" |
| 74 |
|
|
mv "$DEFAULT_DISPLAY_MANAGER_FILE" \ |
| 75 |
|
|
"$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp" |
| 76 |
|
|
fi |
| 77 |
|
|
fi |
| 78 |
|
|
fi |
| 79 |
|
|
|
| 80 |
|
|
exit 0 |