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.
 
 
 

38 lines
872 B

  1. #!/bin/sh
  2. # Test-default-desktop: 3 $desktopname
  3. #
  4. # Will check if tasksel/desktop has been preseeded to "$desktopname",
  5. # or if it's the default desktop for the architecture.
  6. # If so, marks the task for installation.
  7. #
  8. # Otherwise, exits with the provided value.
  9. # (3 will display the task not marked for installation; ).
  10. set +e
  11. DEFAULT="$2"
  12. DESKTOPNAME="$3"
  13. if ! [ "$NEW_INSTALL" ]; then
  14. exit $DEFAULT
  15. fi
  16. . /usr/share/debconf/confmodule
  17. . /usr/lib/tasksel/default_desktop
  18. check_desktop_wanted() {
  19. # see if the desktop test thinks the system wants a desktop
  20. /usr/lib/tasksel/tests/desktop
  21. if [ "$?" = 2 ]; then
  22. exit 2
  23. fi
  24. }
  25. if db_get "tasksel/desktop" && echo "$RET" | grep -q "$DESKTOPNAME"; then
  26. check_desktop_wanted
  27. else
  28. if [ "$DESKTOPNAME" = "$(default_desktop_for_arch $(dpkg --print-architecture))" ]; then
  29. check_desktop_wanted
  30. fi
  31. fi
  32. exit $DEFAULT