Commit 0a954cc1 authored by Joey Hess's avatar Joey Hess

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).)
parent 4e343d11
...@@ -36,6 +36,7 @@ install: ...@@ -36,6 +36,7 @@ install:
$(DESTDIR)/usr/share/man/man8 $(DESTDIR)/usr/share/man/man8
install -m 755 tasksel.pl $(DESTDIR)/usr/bin/tasksel install -m 755 tasksel.pl $(DESTDIR)/usr/bin/tasksel
install -m 755 tasksel-debconf $(DESTDIR)/usr/lib/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/new-install $(DESTDIR)/usr/lib/tasksel/tests/
install -m 755 tests/debconf $(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/ install -m 755 tests/lang $(DESTDIR)/usr/lib/tasksel/tests/
......
...@@ -5,6 +5,11 @@ tasksel (3.27) UNRELEASED; urgency=low ...@@ -5,6 +5,11 @@ tasksel (3.27) UNRELEASED; urgency=low
[ Joey Hess ] [ Joey Hess ]
* Add orca to lxde and mate. Closes: #762409, #762408 * 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 -- Cyril Brulebois <kibi@debian.org> Sat, 20 Sep 2014 17:43:29 +0200
......
...@@ -18,9 +18,7 @@ _Description: Choose software to install: ...@@ -18,9 +18,7 @@ _Description: Choose software to install:
Template: tasksel/desktop Template: tasksel/desktop
Type: multiselect Type: multiselect
Choices: gnome, kde, xfce, lxde, cinnamon, mate Choices: gnome, kde, xfce, lxde, cinnamon, mate
Default: gnome Description: This can be preseeded to override the default desktop.
Description: The desktop environment to install when the desktop task is selected
This can be preseeded to change the default.
Template: tasksel/title Template: tasksel/title
Type: title Type: title
......
# 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
}
#!/bin/sh #!/bin/sh
# Test-default-desktop: 3 gnome # Test-default-desktop: 3 $desktopname
# Will check if tasksel/desktop has been preseeded to "gnome". #
# If not, exits with the provided value. # Will check if tasksel/desktop has been preseeded to "$desktopname",
# (3 will display the task not marked for installation). # 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 set +e
DEFAULT="$2" DEFAULT="$2"
...@@ -13,12 +17,21 @@ if ! [ "$NEW_INSTALL" ]; then ...@@ -13,12 +17,21 @@ if ! [ "$NEW_INSTALL" ]; then
fi fi
. /usr/share/debconf/confmodule . /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 # see if the desktop test thinks the system wants a desktop
/usr/lib/tasksel/tests/desktop /usr/lib/tasksel/tests/desktop
if [ "$?" = 2 ]; then if [ "$?" = 2 ]; then
exit 2 exit 2
fi 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 fi
exit $DEFAULT exit $DEFAULT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment