File: config

package info (click to toggle)
console-cyrillic 0.9-17.2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 1,424 kB
  • sloc: cpp: 3,917; sh: 3,154; perl: 752; makefile: 139
file content (190 lines) | stat: -rw-r--r-- 4,331 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/sh

set -e

choose_ttys () {
    db_input medium console-cyrillic/ttys || true
}

choose_keyboard () {
    db_beginblock
    if [ -f /etc/console-cyrillic ]; then
	db_input high console-cyrillic/kbdtype || true
    else
	case "$LANG" in
	    be*)
		db_set console-cyrillic/kbdtype Belarusian
		db_input medium console-cyrillic/kbdtype || true
		;;
	    bg*)
		# no default keyboard in Bulgaria, so high priority
		db_set console-cyrillic/kbdtype 'Bulgarian BDS'
		db_input high console-cyrillic/kbdtype || true
		;;
	    mk*)
		db_set console-cyrillic/kbdtype Macedonian
		db_input medium console-cyrillic/kbdtype || true
		;;
	    mn*)
		db_set console-cyrillic/kbdtype Mongolian
		db_input medium console-cyrillic/kbdtype || true
		;;
	    ru*)
		db_set console-cyrillic/kbdtype 'Russian Winkeys'
		db_input medium console-cyrillic/kbdtype || true
		;;
	    sr*)
		db_set console-cyrillic/kbdtype Serbian
		db_input medium console-cyrillic/kbdtype || true
		;;
	    uk*)
		db_set console-cyrillic/kbdtype 'Ukrainian Winkeys'
		db_input medium console-cyrillic/kbdtype || true
		;;
	    *)
		db_input high console-cyrillic/kbdtype || true
		;;
	esac
    fi
    db_input high console-cyrillic/toggle || true
    db_input high console-cyrillic/switch || true
    db_endblock
}

choose_font () {
    if [ -f /etc/console-cyrillic ]; then
	db_input medium console-cyrillic/fontstyle || true
    else
	case "$LANG" in
	    be*|bg*|mk*|ru*|sr*|uk*)
		db_set console-cyrillic/fontstyle 'UniCyr'
		;;
	    mn*)
		db_set console-cyrillic/fontstyle 'Terminus Asian Bold'
		;;
	    *)
		db_set console-cyrillic/fontstyle 'Terminus Unicode Bold'
		;;
	esac
	db_input medium console-cyrillic/fontstyle || true
    fi
}

choose_size () {
    db_get console-cyrillic/fontstyle
    fontstyle="$RET"
    case "$fontstyle" in
	B|C|Lenta|Antiq|Sans)
	    sizes="16";;
	A|Alt|UniCyr|ISO|DOS)
	    sizes="16, 14, 8";;
	Cage)
	    sizes="19, 18, 16, 15, 14, 12, 11, 10, 8";;
	Thin)
	    sizes="16, 14";;
	Sarge)
	    sizes="16";;
	Arab)
	    sizes="18, 16, 14, 8";;
	Pln)
	    sizes="16, 14, 8";;
	Terminus*)
	    sizes="16, 14";;
	A\ Asian|B\ Asian|Antiq\ Asian)
             sizes="16";;
    esac
    db_subst console-cyrillic/fontsize fontsizes $sizes
    db_input medium console-cyrillic/fontsize || true
}

choose_encoding () {
    if [ -f /etc/console-cyrillic ]; then
	db_input high console-cyrillic/encoding || true
    else
	case "$LANG" in
	    mn_MN|*.UTF-8)
		db_set console-cyrillic/encoding UNICODE
		db_input medium console-cyrillic/encoding || true
		;;
	    be_BY|bg_BG)
		db_set console-cyrillic/encoding CP1251
		db_input medium console-cyrillic/encoding || true
		;;
	    mk_MK|ru_RU|sr_YU@cyrillic)
		db_set console-cyrillic/encoding ISO-8859-5
		db_input medium console-cyrillic/encoding || true
		;;
	    *.KOI8-R)
		db_set console-cyrillic/encoding KOI8-R
		db_input medium console-cyrillic/encoding || true
		;;
	    uk_UA|ru_UA)
		db_set console-cyrillic/encoding KOI8-U
		db_input medium console-cyrillic/encoding || true
		;;
	    *)
		db_input high console-cyrillic/encoding || true
		;;
	esac
    fi
}

choose_bootsetup () {
    if [ -f /etc/console-cyrillic ]; then
	db_input high console-cyrillic/bootsetup || true
    else
	case "$LANG" in
	    be*|bg*|mk*|mn*|ru*|sr*|uk*)
		db_set console-cyrillic/bootsetup true
		db_input medium console-cyrillic/bootsetup || true
		;;
	    *)
		db_input medium console-cyrillic/bootsetup || true
		;;
	esac
    fi
}

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

# This conf script is capable of backing up
db_capb backup

db_title "Cyrillic on Console"

STATE=1
while [ "$STATE" != 0 ] && [ "$STATE" != 7 ]; do
    case "$STATE" in
	1)
	    choose_ttys;;
	2)
	    choose_keyboard;;
	3)
	    choose_font;;
	4)
	    choose_size;;
	5)
	    choose_encoding;;
	6)
	    choose_bootsetup;;
    esac
    if db_go; then
	STATE=$(($STATE + 1))
    else
	STATE=$(($STATE - 1))
    fi
done

# By default change /etc/console-cyrillic
db_set console-cyrillic/change_config true

if [ -f /etc/console-cyrillic ]; then
    if grep -i '^ *# *debconf: *no' /etc/console-cyrillic >/dev/null; then
	# Do not change /etc/console-cyrillic
	db_input medium console-cyrillic/abusing_debconf || true
	db_set console-cyrillic/change_config false
	db_go || true
    fi
fi