~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to debian/lightdm.config

  • Committer: Robert Ancell
  • Date: 2013-10-07 23:46:13 UTC
  • Revision ID: robert.ancell@canonical.com-20131007234613-v73q6xl6uojgk3fy
BringĀ packagingĀ in-tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
# 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
 
52
else
 
53
    db_input high shared/default-x-display-manager || :
 
54
    db_go || :
 
55
fi
 
56
 
 
57
# using this display manager?
 
58
NEW_DEFAULT=
 
59
if db_get shared/default-x-display-manager; then
 
60
  NEW_DEFAULT="$RET"
 
61
fi
 
62
 
 
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"
 
69
    fi
 
70
  fi
 
71
fi