~ubuntu-branches/ubuntu/quantal/lightdm-kde/quantal

« back to all changes in this revision

Viewing changes to debian/config

  • Committer: Package Import Robot
  • Author(s): Aurélien Gâteau
  • Date: 2012-02-14 16:48:06 UTC
  • Revision ID: package-import@ubuntu.com-20120214164806-1h5fuu1yn3lv01jt
Tags: 0.0.git20120214-0ubuntu1
Initial package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
set -e
 
3
 
 
4
# source debconf library
 
5
. /usr/share/debconf/confmodule
 
6
 
 
7
LIGHTDM_DEBCONF_KEY=shared/lightdm-greeter
 
8
LIGHTDM_CONF=/etc/lightdm/lightdm.conf
 
9
 
 
10
get_lightdm_greeter() {
 
11
    sed -n -e '/^\[SeatDefault\]/,/^\[/p' $LIGHTDM_CONF \
 
12
        | awk -F= '$1 =="greeter-session" { print $2 }'
 
13
}
 
14
 
 
15
OWNERS=
 
16
if db_metaget $LIGHTDM_DEBCONF_KEY owners; then
 
17
    OWNERS="$RET"
 
18
fi
 
19
 
 
20
CHOICES=
 
21
if db_metaget $LIGHTDM_DEBCONF_KEY choices; then
 
22
    CHOICES="$RET"
 
23
fi
 
24
 
 
25
if [ "$OWNERS" != "$CHOICES" ]; then
 
26
    db_subst $LIGHTDM_DEBCONF_KEY choices "$OWNERS" || :
 
27
    db_fset $LIGHTDM_DEBCONF_KEY seen false || :
 
28
fi
 
29
 
 
30
# debconf is not a registry; use the current greeter setting to pre-answer the
 
31
# question if possible
 
32
if [ -e "$LIGHTDM_CONF" ]; then
 
33
    CURRENT_DEFAULT=$(get_lightdm_greeter)
 
34
    if [ -n "$CURRENT_DEFAULT" ]; then
 
35
        db_set $LIGHTDM_DEBCONF_KEY "$CURRENT_DEFAULT"
 
36
    fi
 
37
fi
 
38
 
 
39
# when installing from scratch as part of a release upgrade, default to
 
40
# us, otherwise ask
 
41
if [ -z "$2" -a -n "$RELEASE_UPGRADE_IN_PROGRESS" ]; then
 
42
    db_set $LIGHTDM_DEBCONF_KEY $THIS_PACKAGE
 
43
    db_fset $LIGHTDM_DEBCONF_KEY seen true
 
44
else
 
45
    db_input high $LIGHTDM_DEBCONF_KEY || :
 
46
    db_go || :
 
47
fi