Browse Source

Add logic to be able to override the default desktop on a per-arch basis

Override to xfce for kfreebsd and hurd. This was previously done in several
different places, including debian-cd and d-i boot parameters.

tasksel/desktop no longer has a default value, instead
/usr/lib/tasksel/default_desktop is used to look it up for an architecture.
This shell library might also be used by eg, debian-cd.

(It would also be ok to make tests/default-desktop vary the default based on
eg, machine hardware (ie, for a tablet, or a machine without much ram).)
tags/debian/3.27
Joey Hess 6 years ago
parent
commit
0a954cc184
5 changed files with 35 additions and 8 deletions
  1. +1
    -0
      Makefile
  2. +5
    -0
      debian/changelog
  3. +1
    -3
      debian/templates
  4. +10
    -0
      default_desktop
  5. +18
    -5
      tests/default-desktop

+ 1
- 0
Makefile View File

@@ -36,6 +36,7 @@ install:
$(DESTDIR)/usr/share/man/man8
install -m 755 tasksel.pl $(DESTDIR)/usr/bin/tasksel
install -m 755 tasksel-debconf $(DESTDIR)/usr/lib/tasksel/
install -m 644 default_desktop $(DESTDIR)/usr/lib/tasksel/
install -m 755 tests/new-install $(DESTDIR)/usr/lib/tasksel/tests/
install -m 755 tests/debconf $(DESTDIR)/usr/lib/tasksel/tests/
install -m 755 tests/lang $(DESTDIR)/usr/lib/tasksel/tests/


+ 5
- 0
debian/changelog View File

@@ -5,6 +5,11 @@ tasksel (3.27) UNRELEASED; urgency=low

[ Joey Hess ]
* Add orca to lxde and mate. Closes: #762409, #762408
* Add logic to be able to override the default desktop on a per-arch basis,
and override to xfce for kfreebsd and hurd. This was previously done in
several different places, including debian-cd and d-i boot parameters.
* /usr/lib/tasksel/default_desktop is a shell library that debian-cd
etc can use if they want to know what tasksel's default is.

-- Cyril Brulebois <kibi@debian.org> Sat, 20 Sep 2014 17:43:29 +0200



+ 1
- 3
debian/templates View File

@@ -18,9 +18,7 @@ _Description: Choose software to install:
Template: tasksel/desktop
Type: multiselect
Choices: gnome, kde, xfce, lxde, cinnamon, mate
Default: gnome
Description: The desktop environment to install when the desktop task is selected
This can be preseeded to change the default.
Description: This can be preseeded to override the default desktop.

Template: tasksel/title
Type: title


+ 10
- 0
default_desktop View File

@@ -0,0 +1,10 @@
# shell library to get the default desktop that tasksel will select
# for an architecture

default_desktop_for_arch() {
case "$1" in
kfreebsd-*) echo xfce ;;
hurd-*) echo xfce ;;
*) echo gnome ;;
esac
}

+ 18
- 5
tests/default-desktop View File

@@ -1,8 +1,12 @@
#!/bin/sh
# Test-default-desktop: 3 gnome
# Will check if tasksel/desktop has been preseeded to "gnome".
# If not, exits with the provided value.
# (3 will display the task not marked for installation).
# Test-default-desktop: 3 $desktopname
#
# Will check if tasksel/desktop has been preseeded to "$desktopname",
# or if it's the default desktop for the architecture.
# If so, marks the task for installation.
#
# Otherwise, exits with the provided value.
# (3 will display the task not marked for installation; ).
set +e

DEFAULT="$2"
@@ -13,12 +17,21 @@ if ! [ "$NEW_INSTALL" ]; then
fi

. /usr/share/debconf/confmodule
. /usr/lib/tasksel/default_desktop

if db_get "tasksel/desktop" && echo "$RET" | grep -q "$DESKTOPNAME"; then
check_desktop_wanted() {
# see if the desktop test thinks the system wants a desktop
/usr/lib/tasksel/tests/desktop
if [ "$?" = 2 ]; then
exit 2
fi
}

if db_get "tasksel/desktop" && echo "$RET" | grep -q "$DESKTOPNAME"; then
check_desktop_wanted
else
if [ "$DESKTOPNAME" = "$(default_desktop_for_arch $(dpkg --print-architecture))" ]; then
check_desktop_wanted
fi
fi
exit $DEFAULT

Loading…
Cancel
Save