1 | #!/bin/sh -e |
---|
2 | |
---|
3 | rm_conffile() { |
---|
4 | PKGNAME="gdm" |
---|
5 | CONFFILE="$1" |
---|
6 | |
---|
7 | if [ -e "$CONFFILE" ]; then |
---|
8 | md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" |
---|
9 | old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" |
---|
10 | if [ "$md5sum" != "$old_md5sum" ]; then |
---|
11 | echo "Obsolete conffile $CONFFILE has been modified by you." |
---|
12 | echo "Saving as $CONFFILE.dpkg-bak ..." |
---|
13 | mv -f "$CONFFILE" "$CONFFILE".dpkg-bak |
---|
14 | else |
---|
15 | echo "Removing obsolete conffile $CONFFILE ..." |
---|
16 | rm -f "$CONFFILE" |
---|
17 | fi |
---|
18 | fi |
---|
19 | } |
---|
20 | |
---|
21 | if [ "$1" = "upgrade" ] || [ "$1" = "install" ] && \ |
---|
22 | # earlier releases used /etc/gdm/gdm.conf-custom, but upstream uses |
---|
23 | # custom.conf |
---|
24 | dpkg --compare-versions "$2" le-nl "2.26.1-0ubuntu5"; then |
---|
25 | if [ -f /etc/gdm/gdm.conf-custom ]; then |
---|
26 | echo "Renaming /etc/gdm/gdm.conf-custom to /etc/gdm/custom.conf" >&2 |
---|
27 | mv /etc/gdm/gdm.conf-custom /etc/gdm/custom.conf |
---|
28 | fi |
---|
29 | |
---|
30 | # migrate autologin settings |
---|
31 | if ! egrep -q '^(Automatic|Timed)Login(Enable|Delay|)=' /etc/gdm/custom.conf; then |
---|
32 | settings="`egrep '^((Automatic|Timed)LoginEnable=[^f])|^((Automatic|Timed)Login=.)|^TimedLoginDelay=[^3]' /etc/gdm/gdm.conf`" || true |
---|
33 | if [ -n "$settings" ]; then |
---|
34 | echo '[daemon]' >> /etc/gdm/custom.conf |
---|
35 | echo "$settings" >> /etc/gdm/custom.conf |
---|
36 | fi |
---|
37 | fi |
---|
38 | |
---|
39 | # obsolete conffiles |
---|
40 | rm_conffile /etc/gdm/gdm.conf |
---|
41 | rm_conffile /etc/gdm/locale.conf |
---|
42 | rm_conffile /etc/gdm/gdmprefetchlist |
---|
43 | rm_conffile /etc/gdm/XKeepsCrashing |
---|
44 | rm_conffile /etc/gdm/modules/AccessKeyMouseEvents |
---|
45 | rm_conffile /etc/gdm/modules/factory-AccessKeyMouseEvents |
---|
46 | rm_conffile /etc/gdm/modules/AccessDwellMouseEvents |
---|
47 | rm_conffile /etc/gdm/modules/factory-AccessDwellMouseEvents |
---|
48 | fi |
---|
49 | |
---|