]> rtime.felk.cvut.cz Git - sojka/debian/lightdm.git/blob - debian/lightdm.config
upload
[sojka/debian/lightdm.git] / debian / lightdm.config
1 #!/bin/sh
2 # Debian lightdm package configuration script
3 # based on xdm 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
8 set -e
9
10 # source debconf library
11 . /usr/share/debconf/confmodule
12
13 # set default display manager
14 DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
15
16 OWNERS=
17 if db_metaget shared/default-x-display-manager owners; then
18   OWNERS="$RET"
19 fi
20
21 CHOICES=
22 if db_metaget shared/default-x-display-manager choices; then
23   CHOICES="$RET"
24 fi
25
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 || :
29 fi
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
33 if [ -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
40 else
41   CURRENT_DEFAULT=
42   if db_get shared/default-x-display-manager; then
43     CURRENT_DEFAULT="$RET"
44   fi
45 fi
46
47 db_input high shared/default-x-display-manager || :
48 db_go || :
49
50 # using this display manager?
51 NEW_DEFAULT=
52 if db_get shared/default-x-display-manager; then
53   NEW_DEFAULT="$RET"
54 fi
55
56 # move the default display manager file if we are going to change it
57 if [ -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
64 fi