File: postinst

package info (click to toggle)
wdm 1.0-7
  • links: PTS
  • area: main
  • in suites: slink
  • size: 1,368 kB
  • ctags: 527
  • sloc: ansic: 1,805; sh: 647; makefile: 454; perl: 31
file content (71 lines) | stat: -rw-r--r-- 1,977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh -e
#
# WDM postinst.
# 
# (C) 1998, 1999 Marcelo Magallon <mmagallo@debian.org>

wdm_config_file=/etc/X11/wdm/wdm-config
wdm_Xsession=/etc/X11/wdm/Xsession
common_Xsession=/etc/X11/Xsession

case "$1" in
  configure)
    if grep -q '^!.*wdmWm:.*\#fixme\#$' $wdm_config_file ; then
      /usr/sbin/update_wdm_wmlist
    fi

    if dpkg --compare-versions "$2" lt-nl "1.0-7" ; then
      # wdm now uses its own set of configuration files
      if grep -q '/etc/X11/xdm/' $wdm_config_file ; then
        perl -pi -e "s|/etc/X11/xdm/|/etc/X11/wdm/|" $wdm_config_file 
      fi
      # Branden has been kind enough to include the requiered patches
      if grep -q $wdm_Xsession $wdm_config_file ; then
        perl -pi -e "s|$wdm_Xsession|$common_Xsession|" $wdm_config_file 
      fi
    fi
    update-rc.d wdm defaults 99 01 > /dev/null

    nostart=
    for hostname in "" "localhost" "$(hostname)" "$(hostname -f)"; do
      if echo $DISPLAY | grep -q "^$hostname:0.*"; then
        nostart=yes
      fi
    done
    if [ "$(pidof /usr/bin/X11/wdm)" ] ; then
      nostart=yes
    fi
    if grep -q '^ *while \[ ! -e $TESTFILE' /etc/init.d/wdm ; then
      if ! grep -q '^touch /var/run/wdm.ok._0' /etc/X11/wdm/Xsetup_0 ; then
        cat<<EOF

It appears you didn't replace /etc/init.d/wdm with the new version
(probably found in /etc/init.d/wdm.dpkg-dist).  It is advisable that
you use the new script, as the old one tries to detect if the X server
could be successfully started but it relies on /etc/X11/wdm/Xsetup_0
to touch a file.  That method is obsolete as the test is built right
into wdm now. wdm won't be started.

EOF
      nostart=yes
      fi
    fi
    
    [ "$nostart" ] || /etc/init.d/wdm start || true
  ;;

  abort-upgrade)
    /etc/init.d/wdm start
  ;;
    
  abort-deconfigure|abort-remove)
    # how did we got here? Force a non-zero exit code
    exit 1
  ;;

  *)
    echo "postinst called with unkown argument: \$1" >&2
  ;;
esac

exit 0