Browse Source

* Automatically default to selecting desktop task on new installs

if the machine has sufficient ram, disk, and other characteristics that
  suggest it will be used as a desktop. This is just a guess, but is better
  than no guess.
tags/2.27
Joey Hess 16 years ago
parent
commit
d81536bd3f
4 changed files with 192 additions and 80 deletions
  1. +7
    -1
      debian/changelog
  2. +1
    -0
      tasks/desktop
  3. +79
    -79
      tasks/po/debian-tasks.pot
  4. +105
    -0
      tests/desktop

+ 7
- 1
debian/changelog View File

@@ -1,11 +1,17 @@
tasksel (2.27) UNRELEASED; urgency=low

[ Joey Hess ]
* Automatically default to selecting desktop task on new installs
if the machine has sufficient ram, disk, and other characteristics that
suggest it will be used as a desktop. This is just a guess, but is better
than no guess.

* Translations of tasks
- Updated Bulgarian translation (Ognyan Kulev)
* Program translations
- Updated Bulgarian translation (Ognyan Kulev)

-- Ognyan Kulev <ogi@fmi.uni-sofia.bg> Thu, 7 Jul 2005 20:58:46 +0300
-- Joey Hess <joeyh@debian.org> Sat, 9 Jul 2005 17:36:57 +0300

tasksel (2.26) unstable; urgency=low



+ 1
- 0
tasks/desktop View File

@@ -1,6 +1,7 @@
Task: desktop
Relevance: 8
Section: user
Test-desktop: 1
Description: Desktop environment
This task provides basic "desktop" software, including a variety
of session managers, file managers and web browsers. It incorporates


+ 79
- 79
tasks/po/debian-tasks.pot View File

@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-07-06 22:32+0300\n"
"POT-Creation-Date: 2005-07-09 15:11+0300\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"
@@ -244,429 +244,429 @@ msgid ""
msgstr ""

#. Description
#: ../po/debian-tasks.desc:197
#: ../po/debian-tasks.desc:198
msgid "DNS server"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:197
#: ../po/debian-tasks.desc:198
msgid ""
"Selects the BIND DNS server, and related documentation and utility packages."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:205
#: ../po/debian-tasks.desc:206
msgid "File server"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:205
#: ../po/debian-tasks.desc:206
msgid ""
"This task sets up your system to be a file server, supporting both NetBIOS "
"and NFS."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:215
#: ../po/debian-tasks.desc:216
msgid "French environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:215
#: ../po/debian-tasks.desc:216
msgid ""
"This task installs packages and documentation in French to help French "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:226
#: ../po/debian-tasks.desc:227
msgid "French desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:226
#: ../po/debian-tasks.desc:227
msgid "This task localises the desktop in French."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:233
#: ../po/debian-tasks.desc:234
msgid "German environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:233
#: ../po/debian-tasks.desc:234
msgid ""
"This task installs packages and documentation in German to help German "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:244
#: ../po/debian-tasks.desc:245
msgid "German desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:244
#: ../po/debian-tasks.desc:245
msgid "This task localises the desktop in German."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:251
#: ../po/debian-tasks.desc:252
msgid "Greek environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:251
#: ../po/debian-tasks.desc:252
msgid ""
"This task installs packages and documentation in Greek to help Greek "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:261
#: ../po/debian-tasks.desc:262
msgid "Greek desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:261
#: ../po/debian-tasks.desc:262
msgid "This task localises the desktop in Greek."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:268
#: ../po/debian-tasks.desc:269
msgid "Hebrew environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:268
#: ../po/debian-tasks.desc:269
msgid ""
"This task installs programs and documentation in Hebrew to help Hebrew "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:276
#: ../po/debian-tasks.desc:277
msgid "Hebrew desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:276
#: ../po/debian-tasks.desc:277
msgid "This task localises the desktop in Hebrew."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:283
#: ../po/debian-tasks.desc:284
msgid "Italian environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:283
#: ../po/debian-tasks.desc:284
msgid ""
"This task installs packages and documentation in Italian to help Italian "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:294
#: ../po/debian-tasks.desc:295
msgid "Italian desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:294
#: ../po/debian-tasks.desc:295
msgid "This task localises the desktop in Italian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:301
#: ../po/debian-tasks.desc:302
msgid "Japanese environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:301
#: ../po/debian-tasks.desc:302
msgid ""
"This task installs packages that make it easier for Japanese speakers to use "
"Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:313
#: ../po/debian-tasks.desc:314
msgid "Japanese desktop environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:313
#: ../po/debian-tasks.desc:314
msgid "This task localises the desktop in Japanese."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:320
#: ../po/debian-tasks.desc:321
msgid "Korean environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:320
#: ../po/debian-tasks.desc:321
msgid ""
"This task installs packages that make it easier for Korean speakers to use "
"Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:332
#: ../po/debian-tasks.desc:333
msgid "Korean desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:332
#: ../po/debian-tasks.desc:333
msgid "This task localises the desktop in Korean."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:339
#: ../po/debian-tasks.desc:340
msgid "Laptop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:339
#: ../po/debian-tasks.desc:340
msgid "This task installs software useful for a laptop."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:346
#: ../po/debian-tasks.desc:347
msgid "Lithuanian environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:346
#: ../po/debian-tasks.desc:347
msgid ""
"This task installs packages and documentation in Lithuanian to help "
"Lithuanian speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:356
#: ../po/debian-tasks.desc:357
msgid "Lithuanian desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:356
#: ../po/debian-tasks.desc:357
msgid "This task localises the desktop in Lithuanian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:363
#: ../po/debian-tasks.desc:364
msgid "Mail server"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:363
#: ../po/debian-tasks.desc:364
msgid ""
"This task selects a variety of package useful for a general purpose mail "
"server system."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:372
#: ../po/debian-tasks.desc:373
msgid "Norwegian (Bokmaal and Nynorsk) environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:372
#: ../po/debian-tasks.desc:373
msgid ""
"This task installs packages and documentation in Norwegian to help Norwegian "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:383
#: ../po/debian-tasks.desc:384
msgid "Norwegian (Bokmaal and Nynorsk) desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:383
#: ../po/debian-tasks.desc:384
msgid "This task localises the desktop in Norwegian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:390
#: ../po/debian-tasks.desc:391
msgid "Polish environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:390
#: ../po/debian-tasks.desc:391
msgid ""
"This task installs packages and documentation in Polish to help Polish "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:401
#: ../po/debian-tasks.desc:402
msgid "Polish desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:401
#: ../po/debian-tasks.desc:402
msgid "This task localises the desktop in Polish."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:409
#: ../po/debian-tasks.desc:410
msgid "Print server"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:409
#: ../po/debian-tasks.desc:410
msgid "This task sets up your system to be a print server."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:419
#: ../po/debian-tasks.desc:420
msgid "Russian environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:419
#: ../po/debian-tasks.desc:420
msgid ""
"This task installs programs and documentation in Russian to help Russian "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:430
#: ../po/debian-tasks.desc:431
msgid "Russian desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:430
#: ../po/debian-tasks.desc:431
msgid "This task localises the desktop in Russian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:437
#: ../po/debian-tasks.desc:438
msgid "Spanish environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:437
#: ../po/debian-tasks.desc:438
msgid ""
"This task installs programs, data files, and documentation that make it "
"easier for Spanish speakers to use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:448
#: ../po/debian-tasks.desc:449
msgid "Spanish desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:448
#: ../po/debian-tasks.desc:449
msgid "This task localises the desktop in Spanish."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:455
#: ../po/debian-tasks.desc:456
msgid "Standard system"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:455
#: ../po/debian-tasks.desc:456
msgid "This task installs a reasonably small character-mode system."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:462
#: ../po/debian-tasks.desc:463
msgid "Swedish environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:462
#: ../po/debian-tasks.desc:463
msgid ""
"This task installs packages and documentation in Swedish to help Swedish "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:472
#: ../po/debian-tasks.desc:473
msgid "Swedish desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:472
#: ../po/debian-tasks.desc:473
msgid "This task localises the desktop in Swedish."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:479
#: ../po/debian-tasks.desc:480
msgid "Thai environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:479
#: ../po/debian-tasks.desc:480
msgid ""
"This task installs packages that make it easier for Thai speaking people to "
"use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:491
#: ../po/debian-tasks.desc:492
msgid "Thai desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:491
#: ../po/debian-tasks.desc:492
msgid "This task localises the desktop in Thai."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:498
#: ../po/debian-tasks.desc:499
msgid "Turkish environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:498
#: ../po/debian-tasks.desc:499
msgid ""
"This task installs packages and documentation in Turkish to help Turkish "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:510
#: ../po/debian-tasks.desc:511
msgid "Turkish desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:510
#: ../po/debian-tasks.desc:511
msgid "This task localises the desktop in Turkish."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:517
#: ../po/debian-tasks.desc:518
msgid "Ukrainian environment"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:517
#: ../po/debian-tasks.desc:518
msgid ""
"This task installs programs and documentation in Ukrainian to help Ukrainian "
"speaking people use Debian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:527
#: ../po/debian-tasks.desc:528
msgid "Ukrainian desktop"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:527
#: ../po/debian-tasks.desc:528
msgid "This task localises the desktop in Ukrainian."
msgstr ""

#. Description
#: ../po/debian-tasks.desc:535
#: ../po/debian-tasks.desc:536
msgid "Web server"
msgstr ""

#. Description
#: ../po/debian-tasks.desc:535
#: ../po/debian-tasks.desc:536
msgid ""
"This task selects packages useful for a general purpose web server system."
msgstr ""

+ 105
- 0
tests/desktop View File

@@ -0,0 +1,105 @@
#!/bin/sh
# Try to guess at whether the user would like a desktop installed on their
# system. Of course Debian has many users who use it on a wide array of
# hardware, so this is tricky, but it's only a default.
set -e

if ! [ "$NEW_INSTALL" ]; then
exit 3
fi

arch="$(dpkg --print-architecture)"

unmark () {
exit 3
}
mark () {
exit 2
}

# A few arches have the lion's share of desktops.
common_desktop_architecture () {
case "$arch" in
i386|amd64|powerpc*)
return 0
;;
*)
return 1
;;
esac
}

# On some arches it's almost unheard of to run a desktop, at least using
# this task.
unlikely_desktop_architecture () {
case "$arch" in
m68k|s390|hppa)
return 0
;;
*)
return 1
;;
esac
}

# Modern desktops take a lot of ram.
enough_ram () {
min_ram=64
ram=$(grep ^MemTotal: /proc/meminfo | { read x y z; echo $y; }) || true # kb
# The 4 is a fuzz factor to allow for kernel ram usage.
if [ "$ram" ] && [ "$ram" -ge "$(expr $(expr $min_ram - 4) \* 1024)" ]; then
return 0
else
return 1
fi
}

# The desktop task requires 2 gb or so of disk in /usr.
# FIXME: this should really be generalised and used for tasksel to not
# suggest any task for which there is not enough disk.
enough_disk () {
min_disk=2
disk=$(df /usr | tail -1 | awk '{print $4}')
if [ "$disk" ] && [ "$disk" -ge "$(expr $min_disk \* 1024 \* 1024)" ]; then
return 0
else
return 1
fi
}

desktop_hardware () {
if laptop-detect; then
# Nearly always appropriate to include a desktop.
return 0
else
# TODO: test for the existence of a framebuffer and a mouse.
# A mouse, in particular, almost always indicates a
# desktop.
:
fi
return 1
}

if ! enough_ram || ! enough_disk; then
unmark
fi

if desktop_hardware; then
mark
fi

if unlikely_desktop_architecture; then
unmark
elif common_desktop_architecture; then
# XXX further heuristics here to avoid selecting the task on
# high-end hardware that's intended to be used as a server.
# For example, if it has two NICs with link, it's probably a
# server. If it's rackmountable, a server, etc.

mark # probably a desktop ...
else
# XXX further heuristics here
:
fi

unmark

Loading…
Cancel
Save