File: postinst

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 (220 lines) | stat: -rw-r--r-- 4,751 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
#!/bin/sh

set -e

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

p=console-cyrillic

if [ "$1" = "configure" ]; then
    update-rc.d console-cyrillic start 61 S . >/dev/null

    db_get console-cyrillic/ttys
    ttys="$RET";
    db_get console-cyrillic/fontstyle
    case "$RET" in
        UniCyr)
	    style=uni;;
        DOS)
	    style=dos;;
        Alt)
	    style=alt;;
        Pln)
	    style=ibm;;
# For compatability with old version
        IBM)
	    style=ibm;;
        Cage)
	    style=cage;;
        Thin)
	    style=thin;;
        Sarge)
	    style=sarge;;
        Antiq)
	    style=antiq;;
        Sans)
	    style=sans;;
        Lenta)
	    style=lenta;;
        A)
	    style=a;;
        B)
	    style=b;;
        C)
	    style=c;;
        ISO)
	    style=iso;;
        Arab)
	    style=arab;;
	Terminus\ Unicode\ Normal)
	    style=ter-uni-norm;;
	Terminus\ Unicode\ Bold)
	    style=ter-uni-bold;;
	Terminus\ Unicode\ Framebuffer)
	    style=ter-uni-framebuf;;
	Terminus\ Asian\ Normal)
	    style=ter-asia-norm;;
	Terminus\ Asian\ Bold)
	    style=ter-asia-bold;;
	Terminus\ Asian\ Framebuffer)
	    style=ter-asia-framebuf;;
	Terminus\ Slavic\ Normal)
	    style=ter-slav-norm;;
	Terminus\ Slavic\ Bold)
	    style=ter-slav-bold;;
	Terminus\ Slavic\ Framebuffer)
	    style=ter-slav-framebuf;;
	A\ Asian)
	    style=a-asia;;
	B\ Asian)
	    style=b-asia;;
	Antiq\ Asian)
	    style=antiq-asia;;
        *)
    	echo "Unknown style $RET"
        exit 2;;
    esac
    db_get console-cyrillic/fontsize
    size=$RET
    if [ "$size" = 8 ] && [ "$style" = ibm ]; then
        style=pln
    fi
    db_get console-cyrillic/kbdtype
    case "$RET" in
        Belarusian)
	    layout=by;;
        Bulgarian\ BDS)
	    layout=bg_bds;;
        Bulgarian\ phonetic)
	    layout=bg_phon;;
        Kazakh)
	    layout=kaz_gost;;
        Kazakh\ with\ letter\ IO)
	    layout=kaz_alt;;
        Macedonian)
	    layout=mk;;
        Mongolian)
	    layout=mn;;
        Russian)
	    layout=ru;;
        Russian\ Winkeys)
	    layout=ru_ms;;
        Ukrainian)
	    layout=ua;;
        Ukrainian\ Winkeys)
	    layout=ua_ms;;
        Serbian)
	    layout=sr;;
# For compatability with old version
        Yugoslavian)
	    layout=sr;;
        *)
	    echo "Unknown keyboard $RET"
	    exit 2;;
    esac
    db_get console-cyrillic/toggle
    case "$RET" in
        Caps\ Lock)
	    toggle=caps_toggle;;
        Right\ Alt)
	    toggle=toggle;;
        Right\ Control)
	    toggle=right_ctrl_toggle;;
        Right\ Shift)
	    toggle=shift_toggle;;
        Alt+Shift)
	    toggle=alt_shift_toggle;;
        Control+Shift)
	    toggle=ctrl_shift_toggle;;
        Control+Alt)
	    toggle=ctrl_alt_toggle;;
        Left\ Windows\ logo\ key)
	    toggle=lwin_toggle;;
        Right\ Windows\ logo\ key)
	    toggle=rwin_toggle;;
        Menu\ key)
	    toggle=menu_toggle;;
        *)
	    echo "Unknown keyboard toggle $RET"
	    exit 2;;
    esac
    db_get console-cyrillic/switch
    case "$RET" in
        Right\ Alt)
	    switch=switch;;
        Menu\ key)
	    switch=menu_switch;;
        Left\ Windows\ logo\ key)
	    switch=lwin_switch;;
        Right\ Windows\ logo\ key)
	    switch=rwin_switch;;
        Both\ Windows\ logo\ keys)
	    switch=win_switch;;
        No\ temporary\ switch)
	    switch="";;
        *)
	    echo "Unknown keyboard switch $RET"
	    exit 2;;
    esac
    db_get console-cyrillic/encoding
    case "$RET" in
        UNICODE)
	    encoding=utf-8;;
        CP866)
	    encoding=cp866;;
        CP1251)
	    encoding=cp1251;;
        ISO-8859-5)
	    encoding=iso-8859-5;;
        KOI8-R)
	    encoding=koi8-r;;
        KOI8-U)
	    encoding=koi8-u;;
        MAC-CYRILLIC)
	    encoding=mac-cyrillic;;
        MIK)
	    encoding=mik;;
        PT154)
	    encoding=pt154;;
        *)
	    echo "Unknown keyboard encoding $RET"
	    exit 2;;
    esac
    db_get console-cyrillic/bootsetup
    case "$RET" in
	true)
	    bootsetup=YES;;
	false)
	    bootsetup=NO;;
    esac
    db_get console-cyrillic/change_config
    if [ "$RET" = "true" ]; then
	DEBCONF_FILE=/etc/console-cyrillic
    else
	DEBCONF_FILE=/etc/console-cyrillic.debconf
    fi

    cat >$DEBCONF_FILE <<EOF 
# This is the system wide configuration file for cyr(1).
# In Debian it is used also by /etc/rcS.d/S61console-cyrillic
# (Package: console-cyrillic)

# LOOK:
#     Change this to NO if you don't want this file to be altered by Debconf.
# Debconf: YES

# LOOK:
#     Set this to NO if you don't want the package console-cyrillic
#     to setup Cyrillic on console at boot-time.  Otherwise set it YES.
# Bootsetup: $bootsetup

style $style
size $size
encoding $encoding
layout $layout
options $toggle $switch
ttys $ttys
EOF

fi