| 1 |
#!/bin/sh |
| 2 |
# because debconf sucks |
| 3 |
. /usr/share/debconf/confmodule |
| 4 |
set -e |
| 5 |
|
| 6 |
# provide an exit path, and abort if none is possible |
| 7 |
db_capb backup |
| 8 |
|
| 9 |
tmpfile=$1 |
| 10 |
choices="$2" |
| 11 |
choicestrans="$3" |
| 12 |
defaults="$4" |
| 13 |
question=$5 |
| 14 |
|
| 15 |
db_settitle tasksel/title |
| 16 |
db_subst $question CHOICES_C "$choices" |
| 17 |
db_subst $question CHOICES "$choicestrans" |
| 18 |
|
| 19 |
# Allow tasksel/first to be preseeded. If it's marked as seen, then |
| 20 |
# it must have been preseeded, and that overrides any defaults set by |
| 21 |
# tasksel. |
| 22 |
if [ "$question" = "tasksel/first" ]; then |
| 23 |
db_fget $question seen |
| 24 |
if [ "$RET" = false ]; then |
| 25 |
db_set $question "$defaults" |
| 26 |
fi |
| 27 |
else |
| 28 |
db_set $question "$defaults" |
| 29 |
fi |
| 30 |
|
| 31 |
db_input high $question || true |
| 32 |
db_go # note: intentionally unguarded |
| 33 |
db_fset $question seen false |
| 34 |
db_get $question |
| 35 |
echo "$RET" >$tmpfile |