summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-09-23 14:14:44 -0400
committerJoey Hess <joey@kitenet.net>2014-09-23 14:34:37 -0400
commit0a954cc1840b3059834608df87551a09c1c58b8f (patch)
tree64ec50bf4a77dc9ec30ed45f4fa47212f366642e
parent4e343d11a609041f6b5ac2ab072a03d3d8dfb2c4 (diff)
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).)
-rw-r--r--Makefile1
-rw-r--r--debian/changelog5
-rw-r--r--debian/templates4
-rw-r--r--default_desktop10
-rwxr-xr-xtests/default-desktop23
5 files changed, 35 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index b1d0a7ea..e50692fa 100644
--- a/Makefile
+++ b/Makefile
@@ -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/
diff --git a/debian/changelog b/debian/changelog
index 9906145f..a0222d75 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/debian/templates b/debian/templates
index 141fb4ed..bccc7197 100644
--- a/debian/templates
+++ b/debian/templates
@@ -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
diff --git a/default_desktop b/default_desktop
new file mode 100644
index 00000000..7bef1c60
--- /dev/null
+++ b/default_desktop
@@ -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
+}
diff --git a/tests/default-desktop b/tests/default-desktop
index 253ebe08..10d4a449 100755
--- a/tests/default-desktop
+++ b/tests/default-desktop
@@ -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