2
# Debian lightdm package configuration script
4
# Copyright 2000-2001 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>.
10
# source debconf library
11
. /usr/share/debconf/confmodule
13
# set default display manager
14
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
17
if db_metaget shared/default-x-display-manager owners; then
22
if db_metaget shared/default-x-display-manager choices; then
26
if [ "$OWNERS" != "$CHOICES" ]; then
27
db_subst shared/default-x-display-manager choices "$OWNERS" || :
28
db_fset shared/default-x-display-manager seen false || :
31
# debconf is not a registry; use the current contents of the default display
32
# manager file to pre-answer the question if possible
33
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
34
CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
35
"$DEFAULT_DISPLAY_MANAGER_FILE" |
37
if [ -n "$CURRENT_DEFAULT" ]; then
38
db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
42
if db_get shared/default-x-display-manager; then
43
CURRENT_DEFAULT="$RET"
47
# when installing from scratch as part of a release upgrade, default to
48
# lightdm, otherwise ask
49
if [ -z "$2" -a -n "$RELEASE_UPGRADE_IN_PROGRESS" ]; then
50
db_set shared/default-x-display-manager lightdm
51
db_fset shared/default-x-display-manager seen true
53
db_input high shared/default-x-display-manager || :
57
# using this display manager?
59
if db_get shared/default-x-display-manager; then
63
# move the default display manager file if we are going to change it
64
if [ -n "$NEW_DEFAULT" ]; then
65
if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then
66
if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
67
mv "$DEFAULT_DISPLAY_MANAGER_FILE" \
68
"${DEFAULT_DISPLAY_MANAGER_FILE}.dpkg-tmp"