~ubuntu-core-dev/ubiquity/trunk

1007 by Colin Watson
* Reorganise component packaging. Instead of having to modify each d-i
1
#! /bin/sh
2
set -e
3
4
. /usr/share/debconf/confmodule
5
db_capb backup
6
7
# For now, this is a separate script from tzsetup because we want to ask the
8
# time zone question even if there's only one plausible zone for the
9
# selected language's default country.
10
11
db_get debian-installer/country
12
CC="$RET"
13
# per-country templates are used for countries with multiple choices
14
if db_get "tzsetup/country/$CC"; then
15
	db_register "tzsetup/country/$CC" time/zone
16
	db_fget time/zone seen
17
	if [ "$RET" = false ]; then
18
		db_reset time/zone
19
	fi
20
	db_input high time/zone || :
21
	if ! db_go; then
22
		exit 10 # back to menu
23
	fi
24
else
25
	db_register time/zone time/zone # might be registered to something else
1009 by Colin Watson
install tzmap
26
	# tzmap is also in oem-config-timezone (with a different path);
27
	# later, this should be moved into a tzsetup.deb.
1121 by Colin Watson
* Rename from espresso to ubiquity, to better suggest an association with
28
	zone=$(grep "^$CC" /usr/lib/ubiquity/tzsetup/tzmap | cut -d ' ' -f 2)
1007 by Colin Watson
* Reorganise component packaging. Instead of having to modify each d-i
29
	db_set time/zone "$zone"
30
	db_input high time/zone || true
31
	if ! db_go; then
32
		exit 10 # back to menu
33
	fi
34
fi
1059 by Colin Watson
* Reconfigure the locale according to the selected country after the
35
36
# Reconfigure locale according to the selected country. We rely on
1121 by Colin Watson
* Rename from espresso to ubiquity, to better suggest an association with
37
# ubiquity/components/timezone.py having set debian-installer/country for
1059 by Colin Watson
* Reconfigure the locale according to the selected country after the
38
# us.
39
db_get debian-installer/country
40
country="$RET"
1433 by Colin Watson
* Always set mirror/country to the country selected on the timezone page,
41
db_set mirror/country "$country"
1059 by Colin Watson
* Reconfigure the locale according to the selected country after the
42
db_get debian-installer/locale
43
newlocale="$(echo "$RET" | sed "s/_[A-Z][A-Z]*/_$country/")"
1646 by Colin Watson
* Don't reset the locale or run localechooser again if the country
44
if grep -q "^${newlocale%%[.@]*}[.@ ]" /usr/share/i18n/SUPPORTED; then
45
	db_set debian-installer/locale "$newlocale"
46
	db_fset debian-installer/locale seen true
1736 by Colin Watson
* Make sure localechooser doesn't clobber the selected country if it
47
	# Let localechooser know that we're using the same language as
48
	# before, so that it doesn't set a default country again.
49
	db_fset languagechooser/language-name seen true
1646 by Colin Watson
* Don't reset the locale or run localechooser again if the country
50
	db_set localechooser/alreadyrun false
51
	PATH="/usr/lib/ubiquity/localechooser:$PATH" \
52
		/usr/lib/ubiquity/localechooser/localechooser
53
fi