You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 lines
1.9 KiB

  1. #! /bin/sh
  2. # Debian slim package configuration script
  3. # Copyright 2007 Darren Salt
  4. # Licensed under the GNU General Public License, version 2. See the file
  5. # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
  6. # adapted from xdm's config script
  7. # Debian xdm package configuration script
  8. # Copyright 2000-2003 Branden Robinson.
  9. set -e
  10. # source debconf library
  11. . /usr/share/debconf/confmodule
  12. # set default display manager
  13. DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
  14. OWNERS=
  15. if db_metaget shared/default-x-display-manager owners; then
  16. OWNERS="$RET"
  17. fi
  18. CHOICES=
  19. if db_metaget shared/default-x-display-manager choices; then
  20. CHOICES="$RET"
  21. fi
  22. if [ "$OWNERS" != "$CHOICES" ]; then
  23. db_subst shared/default-x-display-manager choices "$OWNERS" || :
  24. db_fset shared/default-x-display-manager seen false || :
  25. fi
  26. # debconf is not a registry; use the current contents of the default display
  27. # manager file to pre-answer the question if possible
  28. if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
  29. CURRENT_DEFAULT=$(basename "$(grep -v '^[[:space:]]*#' \
  30. "$DEFAULT_DISPLAY_MANAGER_FILE" |
  31. head -n 1)")
  32. if [ -n "$CURRENT_DEFAULT" ]; then
  33. db_set shared/default-x-display-manager "$CURRENT_DEFAULT"
  34. fi
  35. else
  36. CURRENT_DEFAULT=
  37. if db_get shared/default-x-display-manager; then
  38. CURRENT_DEFAULT="$RET"
  39. fi
  40. fi
  41. db_input high shared/default-x-display-manager || :
  42. db_go || :
  43. # using this display manager?
  44. NEW_DEFAULT=
  45. if db_get shared/default-x-display-manager; then
  46. NEW_DEFAULT="$RET"
  47. fi
  48. # move the default display manager file if we're going to change it
  49. if [ -n "$NEW_DEFAULT" ]; then
  50. if [ "$NEW_DEFAULT" != "$CURRENT_DEFAULT" ]; then
  51. if [ -e "$DEFAULT_DISPLAY_MANAGER_FILE" ]; then
  52. mv "$DEFAULT_DISPLAY_MANAGER_FILE" \
  53. "$DEFAULT_DISPLAY_MANAGER_FILE.dpkg-tmp"
  54. fi
  55. fi
  56. fi