Updating watch file to support XZ tarball format and non-numeric versions.
[debian/lxdm.git] / debian / lxdm.config
CommitLineData
6da61772
DB
1#!/bin/sh
2# Debian lxdm package configuration script
3# Largely adapted from gdms config 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>.
7
8set -e
9
10# source debconf library
11. /usr/share/debconf/confmodule
12
13# set default display manager
14DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
15
16OWNERS=
17if db_metaget shared/default-x-display-manager owners; then
18 OWNERS="$RET"
19fi
20
21CHOICES=
22if db_metaget shared/default-x-display-manager choices; then
23 CHOICES="$RET"
24fi
25
26if [ "$OWNERS" != "$CHOICES" ]; then
27 db_subst shared/default-x-display-manager choices "$OWNERS" || :
28 db_fset shared/default-x-display-manager seen false || :
29fi
30
31# debconf is not a registry; use the current contents of the default display
32# manager file to pre-answer the question if possible
33if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
34 CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
35 "$DEFAULT_DISPLAY_MANAGER_FILE" |
36 head -n 1)")
37 if [ -n "$CURRENT_DEFAULT" ]; then
38 db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
39 fi
40else
41 CURRENT_DEFAULT=
42 if db_get shared/default-x-display-manager; then
43 CURRENT_DEFAULT="$RET"
44 fi
45fi
46
47db_input high shared/default-x-display-manager || :
48db_go || :
49
50# using this display manager?
51NEW_DEFAULT=
52if db_get shared/default-x-display-manager; then
53 NEW_DEFAULT="$RET"
54fi
55
56# move the default display manager file if we are going to change it
57if [ -n "$NEW_DEFAULT" ]; then
58 if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then
59 if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
60 mv "$DEFAULT_DISPLAY_MANAGER_FILE" \
61 "${DEFAULT_DISPLAY_MANAGER_FILE}.dpkg-tmp"
62 fi
63 fi
64fi