Commit 9e2290b5 authored by Joey Hess's avatar Joey Hess

hierarchical tasks, desktop selection, and general massive changes

* Individual desktop environments are displayed by tasksel.
  Currently only xfce, gnome, and kde, which are the most popular 3.
* Preseeding tasksel/desktop still works to select the default desktop,
  and now preseeding eg, tasksel/desktop=lxde will also cause that task
  to be displayed by tasksel even when it would not normally be.
* Added a Parent field, which results in a simple nested hierarchy
  display. (Currently only one level deep, and not collapsable since
  debconf doesn't have an appropriate widget.)
* Relevance field order inverted (1 is highest).
* Some strings were fuzzied, but they were all the non-translatable
  names of desktop environments, so this does not hurt actual d-i
  localization, only the stats until those get un-fuzzied.
* Removed mail-server, dns-server, database-server, file-server tasks,
  which were not well enough defined to be useful and whose menu
  space will be better used for blends or openstack tasks.
* Laptop task is no longer displayed, just automatically installed
  when laptop-detect says to. Note that in the case of a false positive,
  only a little extra space is used, and in the case of a false negative,
  nothing in the task is needed for a usable desktop environment on a
  laptop.
parent 737b982a
......@@ -18,12 +18,13 @@ Debian derived distributions can add a new .desc file to
/usr/share/tasksel/ to add additional tasks, or modify/divert
debian-tasks.desc to remove tasks.
The file format is a rfc-822 style stanza, with fields named Task,
The file format is a rfc-822 style stanza, with fields named Task,
Description (which should include an extended description), Key, Packages,
Enhances, Test- and Relevance fields. Here is an example:
Enhances, Test-, Relevance, and Parent fields. Here is an example:
Task: graphical-games
Relevance: 10
Relevance: 9
Parent: games
Description: Graphical games
This task provides a variety of graphical games. Old-school unix games are
not included.
......@@ -85,13 +86,22 @@ enchances a system that has both the french and desktop tasks, and will be
automatically installed on such a system but not others. Such tasks are
hidden from the menu.
If two tasks both enhance the same task (ie, gnome-desktop and kde-desktop
enhancing desktop), but only one should be selected, this can be
accomplished by adding Test-* fields.
If two tasks both enhance the same task, but only one should be selected,
this can be accomplished by adding Test-* fields.
Tasks can be children of a parent task, indicated by using the Parent
field. For example, the desktop task is the parent of gnome-desktop,
kde-desktop, etc. This only controls the display; child tasks are displayed
nested underneath the parent. Only 1 level of nesting is currently
supported. Selecting the parent task does not select any or all of
the child tasks, nor does selecting a child task ensure that the parent
task is installed. Instead, use dependencies between the task packages to
express any such relationships.
If a task is important enough that it should go near the top,
give it a relevance of 9 or 10. If a task is not likely to be
used, give it a relevance of 1. Default is 5.
give it a relevance of 1. If a task is not likely to be
used, give it a relevance of 9. Default is 5. Relevance can only be a
single digit.
tasksel also supports preinst, postinst, prerm, and postrm scripts for
tasks. These are run before a task is installed, and after it is removed as
......
tasksel (3.23) UNRELEASED; urgency=medium
* Individual desktop environments are displayed by tasksel.
Currently only xfce, gnome, and kde, which are the most popular 3.
* Preseeding tasksel/desktop still works to select the default desktop,
and now preseeding eg, tasksel/desktop=lxde will also cause that task
to be displayed by tasksel even when it would not normally be.
* Added a Parent field, which results in a simple nested hierarchy
display. (Currently only one level deep, and not collapsable since
debconf doesn't have an appropriate widget.)
* Relevance field order inverted (1 is highest).
* Some strings were fuzzied, but they were all the non-translatable
names of desktop environments, so this does not hurt actual d-i
localization, only the stats until those get un-fuzzied.
* Removed mail-server, dns-server, database-server, file-server tasks,
which were not well enough defined to be useful and whose menu
space will be better used for blends or openstack tasks.
* Add gnome-orca to task-xfce-desktop; xfce4-accessibility-settings
can be used to enable it. Closes: #760778
* Laptop task is no longer displayed, just automatically installed
when laptop-detect says to. Note that in the case of a false positive,
only a little extra space is used, and in the case of a false negative,
nothing in the task is needed for a usable desktop environment on a
laptop.
-- Joey Hess <joeyh@debian.org> Sun, 07 Sep 2014 16:26:37 -0400
......
......@@ -66,7 +66,7 @@ Recommends:
Package: task-gnome-desktop
Architecture: all
Description: GNOME desktop environment
Description: GNOME
This task package is used to install the Debian desktop, featuring
the GNOME desktop environment, and with other packages that Debian users
expect to have available on the desktop.
......@@ -104,7 +104,7 @@ Recommends:
Package: task-kde-desktop
Architecture: all
Description: KDE desktop environment
Description: KDE
This task package is used to install the Debian desktop, featuring
the KDE desktop environment, and with other packages that Debian users
expect to have available on the desktop.
......@@ -151,7 +151,7 @@ Recommends:
Package: task-lxde-desktop
Architecture: all
Description: LXDE desktop environment
Description: LXDE
This task package is used to install the Debian desktop, featuring
the LXDE desktop environment, and with other packages that Debian users
expect to have available on the desktop.
......@@ -186,7 +186,7 @@ Recommends:
Package: task-xfce-desktop
Architecture: all
Description: Xfce desktop environment
Description: Xfce
This task package is used to install the Debian desktop, featuring
the Xfce desktop environment, and with other packages that Debian users
expect to have available on the desktop.
......@@ -243,7 +243,7 @@ Recommends:
Package: task-cinnamon-desktop
Architecture: all
Description: Cinnamon desktop environment
Description: Cinnamon
This task package is used to install the Debian desktop, featuring
the Cinnamon desktop environment, and with other packages that Debian users
expect to have available on the desktop.
......@@ -279,39 +279,6 @@ Recommends:
apache2-doc,
analog
Package: task-mail-server
Architecture: all
Description: mail server
This task selects a variety of packages useful for a general purpose mail
server system.
Depends: ${misc:Depends},
exim4
Recommends:
dovecot-imapd,
dovecot-pop3d,
mailx,
mutt,
exim4-daemon-light,
exim4-config,
procmail,
mailagent,
# HELP: what about some webmail thing?
spamassassin,
sa-exim,
Package: task-dns-server
Architecture: all
Description: DNS Server
This task selects the BIND DNS server, and related documentation and
utility packages.
Depends: ${misc:Depends},
bind9
Recommends:
bind9-doc,
dnsutils,
lwresd,
dlint
Package: task-print-server
Architecture: all
Description: print server
......@@ -337,41 +304,6 @@ Depends: ${misc:Depends},
Recommends:
openssh-client
Package: task-database-server
Architecture: all
# HELP: Would "relational database server" be a better short desk?
# HELP: the folks on #debian-devel think if you want a db server, you
# probably want to pick between postgres and mysql. Should this task live?
Description: SQL database
This task selects client and server packages for the PostgreSQL database.
.
PostgreSQL is an SQL relational database, offering increasing SQL92
compliance and some SQL3 features. It is suitable for use with multi-user
database access, through its facilities for transactions and fine-grained
locking.
Depends: ${misc:Depends},
postgresql
Recommends:
postgresql-client,
postgresql-doc,
postgresql-contrib
Package: task-file-server
Architecture: all
Description: file server
This task sets up your system to be a file server, supporting both CIFS
and NFS.
Depends: ${misc:Depends},
nfs-kernel-server,
samba
Recommends:
samba-doc,
smbclient,
swat,
cifs-utils,
winbind,
smartmontools
Package: task-albanian-desktop
Architecture: all
Description: Albanian desktop
......
......@@ -7,7 +7,6 @@
# data.c. The format of the input files is:
#
# Task: desktop
# Section: user
# Description: Provide a basic GUI system
# This task provides functionality for a basic desktop; whether Gnome
# based, KDE based or customised. With this task, your system will boot
......@@ -94,7 +93,7 @@ sub processfile {
}
}
foreach (qw{task section relevance description key enhances provides depends packages},
foreach (qw{task parent relevance description key enhances provides depends packages},
grep(/^test-(.*)/, keys %fields)) {
print OUT ucfirst($_).": ".$fields{$_}."\n" if length $fields{$_};
}
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-07 12:26-0400\n"
"POT-Creation-Date: 2014-09-07 21:17-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../tasksel.pl:396
#: ../tasksel.pl:413
msgid ""
"Usage:\n"
"tasksel install <task>...\n"
......@@ -30,6 +30,6 @@ msgid ""
"\t --task-desc returns the description of a task\n"
msgstr ""
#: ../tasksel.pl:637
#: ../tasksel.pl:654
msgid "apt-get failed"
msgstr ""
Task: cinnamon-desktop
Relevance: 8
Enhances: desktop
Test-preferred-desktop: cinnamon
Parent: desktop
Test-default-desktop: 1 cinnamon
Key:
task-cinnamon-desktop
Task: database-server
Key:
task-database-server
Task: desktop
Relevance: 8
Relevance: 1
Test-desktop: 1
Key:
task-desktop
Task: dns-server
Key:
task-dns-server
Task: file-server
Key:
task-file-server
Task: gnome-desktop
Relevance: 8
Enhances: desktop
Test-preferred-desktop: gnome
Relevance: 2
Parent: desktop
Test-default-desktop: 3 gnome
Key:
task-gnome-desktop
Task: kde-desktop
Relevance: 8
Enhances: desktop
Test-preferred-desktop: kde
Relevance: 7
Parent: desktop
Test-default-desktop: 3 kde
Key:
task-kde-desktop
Task: laptop
Test-laptop: 1
Relevance: 9
Key:
task-laptop
Task: lxde-desktop
Relevance: 8
Enhances: desktop
Test-preferred-desktop: lxde
Relevance: 7
Parent: desktop
Test-default-desktop: 1 lxde
Key:
task-lxde-desktop
Task: mail-server
Key:
task-mail-server
Task: print-server
Relevance: 6
Relevance: 4
Test-desktop: 1
Key:
task-print-server
Task: web-server
Relevance: 7
Relevance: 3
Key:
task-web-server
Task: xfce-desktop
Relevance: 8
Enhances: desktop
Test-preferred-desktop: xfce
Relevance: 1
Parent: desktop
Test-default-desktop: 3 xfce
Key:
task-xfce-desktop
......@@ -49,7 +49,7 @@ sub list_task_descs {
# Returns a list of hashes; hash values are arrays for multi-line fields.
sub read_task_desc {
my $desc=shift;
my @ret;
my %tasks;
open (DESC, "<$desc") || die "read $desc\: $!";
local $/="\n\n";
while (<DESC>) {
......@@ -80,12 +80,23 @@ sub read_task_desc {
warning "parse error in stanza $. of $desc";
}
}
if (%data) {
$data{relevance}=5 unless exists $data{relevance};
push @ret, \%data;
$data{relevance}=5 unless exists $data{relevance};
if (exists $data{task}) {
$tasks{$data{task}} = \%data;
}
}
close DESC;
my @ret;
foreach my $task (keys %tasks) {
my $t=$tasks{$task};
if (exists $t->{parent} && exists $tasks{$t->{parent}}) {
$t->{sortkey}=$tasks{$t->{parent}}->{relevance}.$t->{parent}."-0".$t->{relevance};
}
else {
$t->{sortkey}=$t->{relevance}.$t->{task}."-00";
}
push @ret, $t;
}
return @ret;
}
......@@ -343,7 +354,15 @@ sub getdescriptions {
# Converts a list of tasks into a debconf list of the task short
# descriptions.
sub task_to_debconf {
join ", ", map { my $d=$_->{shortdesc}; $d=~s/,/\\,/g; $d } getdescriptions(@_);
join ", ", map { format_description_for_debconf($_) } getdescriptions(@_);
}
sub format_description_for_debconf {
my $task=shift;
my $d=$task->{shortdesc};
$d=~s/,/\\,/g;
$d="... ".$d if exists $task->{parent};
return $d;
}
# Converts a list of tasks into a debconf list of the task names.
......@@ -363,7 +382,7 @@ sub list_to_tasks {
# Orders a list of tasks for display.
sub order_for_display {
sort {
$b->{relevance} <=> $a->{relevance}
$a->{sortkey} cmp $b->{sortkey}
|| 0 ||
$a->{task} cmp $b->{task}
} @_;
......
#!/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).
set +e
DEFAULT="$2"
DESKTOPNAME="$3"
if ! [ "$NEW_INSTALL" ]; then
exit $DEFAULT
fi
. /usr/share/debconf/confmodule
if db_get "tasksel/desktop" && echo "$RET" | grep -q "$DESKTOPNAME"; then
# see if the desktop test thinks the system wants a desktop
/usr/lib/tasksel/tests/desktop
if [ "$?" = 2 ]; then
exit 2
fi
fi
exit $DEFAULT
......@@ -4,9 +4,9 @@
if [ "$NEW_INSTALL" ]; then
if which laptop-detect >/dev/null 2>&1 && \
laptop-detect; then
exit 2 # mark for install
exit 0 # hide; install
else
exit 3 # do not mark for install
exit 1 # hide; do not install
fi
else
exit 3
......
#!/bin/sh
# Choose which desktop environment should be installed to enhance the desktop
# task. tasksel/desktop can be preseeded to select which to install.
set -e
# Avoid starting debconf if not being used to test which enhancing task to
# install.
if [ ! "$TESTING_ENHANCER" ]; then
exit 1
fi
. /usr/share/debconf/confmodule
if db_get "tasksel/desktop" && echo "$RET" | grep -q "$2"; then
exit 0
else
exit 1
fi
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