Merge lp:~eugenenuke/ubuntu/wily/console-setup/fix-for-1565542 into lp:ubuntu/wily/console-setup

Proposed by Evgeniy Yanyuk on 2016-04-09
Status: Merged
Merge reported by: Mathieu Trudel-Lapierre
Merged at revision: not available
Proposed branch: lp:~eugenenuke/ubuntu/wily/console-setup/fix-for-1565542
Merge into: lp:ubuntu/wily/console-setup
Diff against target: 275 lines (+189/-4)
4 files modified
console-setup-tty (+58/-2)
debian/changelog (+9/-0)
debian/console-setup.initramfs-hook (+64/-0)
debian/console-setup.initramfs-top (+58/-2)
To merge this branch: bzr merge lp:~eugenenuke/ubuntu/wily/console-setup/fix-for-1565542
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre 2016-04-09 Approve on 2016-04-19
Review via email: mp+291433@code.launchpad.net

Description of the change

* Properly handle settings CODESET and FONSIZE when they equals 'guess' or are unset.
    - console-setup-tty, debian/console-setup.initramfs-hook,
      debian/console-setup.initramfs-top
    (LP: #1565542)

To post a comment you must log in.
Mathieu Trudel-Lapierre (cyphermox) wrote :

Looks like this indeed fixes ru; and somewhat improves vi. Looks good to me (further improvements would most likely require fixing kbd too)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'console-setup-tty'
2--- console-setup-tty 2010-03-19 11:08:58 +0000
3+++ console-setup-tty 2016-04-09 08:35:42 +0000
4@@ -29,6 +29,62 @@
5
6 . /etc/default/console-setup
7
8+# CODESET
9+[ "$CODESET" != guess ] || CODESET=''
10+if [ -z "$CODESET" ]; then
11+ case "$CHARMAP" in
12+ UTF-8) CODESET=Uni2;;
13+ ARMSCII-8) CODESET=Armenian ;;
14+ CP1251) CODESET=CyrSlav ;;
15+ CP1255) CODESET=Hebrew ;;
16+ CP1256) CODESET=Arabic ;;
17+ GEORGIAN-ACADEMY) CODESET=Georgian ;;
18+ GEORGIAN-PS) CODESET=Georgian ;;
19+ IBM1133) CODESET=Lao ;;
20+ ISIRI-3342) CODESET=Arabic ;;
21+ ISO-8859-1) CODESET=Lat15 ;;
22+ ISO-8859-2) CODESET=Lat2 ;;
23+ ISO-8859-3) CODESET=Lat38 ;;
24+ ISO-8859-4) CODESET=Lat7 ;; # sometimes Lat15
25+ ISO-8859-5) CODESET=CyrSlav ;;
26+ ISO-8859-6) CODESET=Arabic ;;
27+ ISO-8859-7) CODESET=Greek ;;
28+ ISO-8859-8) CODESET=Hebrew ;;
29+ ISO-8859-9) CODESET=Lat15 ;;
30+ ISO-8859-10) CODESET=Lat15 ;;
31+ ISO-8859-11) CODESET=Thai ;;
32+ ISO-8859-13) CODESET=Lat7 ;;
33+ ISO-8859-14) CODESET=Lat38 ;;
34+ ISO-8859-15) CODESET=Lat15 ;;
35+ ISO-8859-16) CODESET=Lat2 ;;
36+ KOI8-R) CODESET=CyrKoi ;;
37+ KOI8-U) CODESET=CyrKoi ;;
38+ TIS-620) CODESET=Thai ;;
39+ VISCII) CODESET=Vietnamese ;;
40+ *) ;;
41+ esac
42+fi
43+
44+# FONTSIZE
45+if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then
46+ FONTSIZE=16
47+fi
48+case "$FONTSIZE" in
49+ 8x*)
50+ FONTSIZE=${FONTSIZE#*x}
51+ ;;
52+ *x8)
53+ FONTSIZE=${FONTSIZE%x*}
54+ ;;
55+ *x*)
56+ a=${FONTSIZE%x*}
57+ b=${FONTSIZE#*x}
58+ if [ "$a" -lt "$b" ]; then
59+ FONTSIZE=${b}x${a}
60+ fi
61+ ;;
62+esac
63+
64 setup_unicode () {
65 # Set up Unicode/non-Unicode mode.
66 # TODO: this will probably break something if terminal line emulation is
67@@ -50,7 +106,7 @@
68 else
69 FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
70 fi
71- if [ -f "$FONT" ]; then
72+ if [ -f "$FONT" ] || [ -f "$FONT.gz" ]; then
73 SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }$FONT"
74 fi
75 if [ "$ACM" ]; then
76@@ -59,7 +115,7 @@
77 else
78 ACM="/etc/console-setup/$CHARMAP.acm"
79 fi
80- if [ -f "$ACM" ]; then
81+ if [ -f "$ACM" ] || [ -f "$ACM.gz" ]; then
82 SETFONT_ARGS="${SETFONT_ARGS:+$SETFONT_ARGS }-m $ACM"
83 fi
84 if [ "$SETFONT_ARGS" ]; then
85
86=== modified file 'debian/changelog'
87--- debian/changelog 2015-10-20 12:51:36 +0000
88+++ debian/changelog 2016-04-09 08:35:42 +0000
89@@ -1,3 +1,12 @@
90+console-setup (1.108ubuntu10) UNRELEASED; urgency=medium
91+
92+ * Properly handle settings CODESET and FONSIZE when they equals 'guess' or are unset.
93+ - console-setup-tty, debian/console-setup.initramfs-hook,
94+ debian/console-setup.initramfs-top
95+ (LP: #1565542)
96+
97+ -- Evgeniy Yanyuk <eugenenuke@gmail.com> Sat, 09 Apr 2016 11:14:28 +0300
98+
99 console-setup (1.108ubuntu9) wily; urgency=medium
100
101 * Cherry-pick fix from git for udpkg/Hurd noise in keyboard-configuration.
102
103=== modified file 'debian/console-setup.initramfs-hook'
104--- debian/console-setup.initramfs-hook 2011-01-20 20:55:01 +0000
105+++ debian/console-setup.initramfs-hook 2016-04-09 08:35:42 +0000
106@@ -18,6 +18,62 @@
107 [ -r /etc/default/console-setup ] || exit 0
108 . /etc/default/console-setup # also sources /etc/default/keyboard
109
110+# CODESET
111+[ "$CODESET" != guess ] || CODESET=''
112+if [ -z "$CODESET" ]; then
113+ case "$CHARMAP" in
114+ UTF-8) CODESET=Uni2;;
115+ ARMSCII-8) CODESET=Armenian ;;
116+ CP1251) CODESET=CyrSlav ;;
117+ CP1255) CODESET=Hebrew ;;
118+ CP1256) CODESET=Arabic ;;
119+ GEORGIAN-ACADEMY) CODESET=Georgian ;;
120+ GEORGIAN-PS) CODESET=Georgian ;;
121+ IBM1133) CODESET=Lao ;;
122+ ISIRI-3342) CODESET=Arabic ;;
123+ ISO-8859-1) CODESET=Lat15 ;;
124+ ISO-8859-2) CODESET=Lat2 ;;
125+ ISO-8859-3) CODESET=Lat38 ;;
126+ ISO-8859-4) CODESET=Lat7 ;; # sometimes Lat15
127+ ISO-8859-5) CODESET=CyrSlav ;;
128+ ISO-8859-6) CODESET=Arabic ;;
129+ ISO-8859-7) CODESET=Greek ;;
130+ ISO-8859-8) CODESET=Hebrew ;;
131+ ISO-8859-9) CODESET=Lat15 ;;
132+ ISO-8859-10) CODESET=Lat15 ;;
133+ ISO-8859-11) CODESET=Thai ;;
134+ ISO-8859-13) CODESET=Lat7 ;;
135+ ISO-8859-14) CODESET=Lat38 ;;
136+ ISO-8859-15) CODESET=Lat15 ;;
137+ ISO-8859-16) CODESET=Lat2 ;;
138+ KOI8-R) CODESET=CyrKoi ;;
139+ KOI8-U) CODESET=CyrKoi ;;
140+ TIS-620) CODESET=Thai ;;
141+ VISCII) CODESET=Vietnamese ;;
142+ *) ;;
143+ esac
144+fi
145+
146+# FONTSIZE
147+if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then
148+ FONTSIZE=16
149+fi
150+case "$FONTSIZE" in
151+ 8x*)
152+ FONTSIZE=${FONTSIZE#*x}
153+ ;;
154+ *x8)
155+ FONTSIZE=${FONTSIZE%x*}
156+ ;;
157+ *x*)
158+ a=${FONTSIZE%x*}
159+ b=${FONTSIZE#*x}
160+ if [ "$a" -lt "$b" ]; then
161+ FONTSIZE=${b}x${a}
162+ fi
163+ ;;
164+esac
165+
166 # Copy console-setup configuration
167 mkdir -p "$DESTDIR/etc/default"
168 cp -p /etc/default/keyboard "$DESTDIR/etc/default"
169@@ -34,6 +90,10 @@
170 mkdir -p "$DESTDIR${FONT%/*}"
171 cp -p "$FONT" "$DESTDIR$FONT"
172 fi
173+if [ -f "$FONT.gz" ]; then
174+ mkdir -p "$DESTDIR${FONT%/*}"
175+ cp -p "$FONT.gz" "$DESTDIR$FONT.gz"
176+fi
177 if [ -f "$ACM" ]; then
178 ACM="/etc/console-setup/${ACM##*/}"
179 ACM="${ACM%.gz}"
180@@ -44,6 +104,10 @@
181 mkdir -p "$DESTDIR${ACM%/*}"
182 cp -p "$ACM" "$DESTDIR$ACM"
183 fi
184+if [ -f "$ACM.gz" ]; then
185+ mkdir -p "$DESTDIR${ACM%/*}"
186+ cp -p "$ACM.gz" "$DESTDIR$ACM.gz"
187+fi
188 if [ -f /etc/console-setup/cached.kmap.gz ]; then
189 mkdir -p "$DESTDIR/etc/console-setup"
190 cp -p /etc/console-setup/cached.kmap.gz \
191
192=== modified file 'debian/console-setup.initramfs-top'
193--- debian/console-setup.initramfs-top 2011-01-20 20:55:01 +0000
194+++ debian/console-setup.initramfs-top 2016-04-09 08:35:42 +0000
195@@ -20,6 +20,62 @@
196
197 [ "$ACTIVE_CONSOLES" ] || exit 0
198
199+# CODESET
200+[ "$CODESET" != guess ] || CODESET=''
201+if [ -z "$CODESET" ]; then
202+ case "$CHARMAP" in
203+ UTF-8) CODESET=Uni2;;
204+ ARMSCII-8) CODESET=Armenian ;;
205+ CP1251) CODESET=CyrSlav ;;
206+ CP1255) CODESET=Hebrew ;;
207+ CP1256) CODESET=Arabic ;;
208+ GEORGIAN-ACADEMY) CODESET=Georgian ;;
209+ GEORGIAN-PS) CODESET=Georgian ;;
210+ IBM1133) CODESET=Lao ;;
211+ ISIRI-3342) CODESET=Arabic ;;
212+ ISO-8859-1) CODESET=Lat15 ;;
213+ ISO-8859-2) CODESET=Lat2 ;;
214+ ISO-8859-3) CODESET=Lat38 ;;
215+ ISO-8859-4) CODESET=Lat7 ;; # sometimes Lat15
216+ ISO-8859-5) CODESET=CyrSlav ;;
217+ ISO-8859-6) CODESET=Arabic ;;
218+ ISO-8859-7) CODESET=Greek ;;
219+ ISO-8859-8) CODESET=Hebrew ;;
220+ ISO-8859-9) CODESET=Lat15 ;;
221+ ISO-8859-10) CODESET=Lat15 ;;
222+ ISO-8859-11) CODESET=Thai ;;
223+ ISO-8859-13) CODESET=Lat7 ;;
224+ ISO-8859-14) CODESET=Lat38 ;;
225+ ISO-8859-15) CODESET=Lat15 ;;
226+ ISO-8859-16) CODESET=Lat2 ;;
227+ KOI8-R) CODESET=CyrKoi ;;
228+ KOI8-U) CODESET=CyrKoi ;;
229+ TIS-620) CODESET=Thai ;;
230+ VISCII) CODESET=Vietnamese ;;
231+ *) ;;
232+ esac
233+fi
234+
235+# FONTSIZE
236+if [ -z "$FONTSIZE" -o "$FONTSIZE" = guess ]; then
237+ FONTSIZE=16
238+fi
239+case "$FONTSIZE" in
240+ 8x*)
241+ FONTSIZE=${FONTSIZE#*x}
242+ ;;
243+ *x8)
244+ FONTSIZE=${FONTSIZE%x*}
245+ ;;
246+ *x*)
247+ a=${FONTSIZE%x*}
248+ b=${FONTSIZE#*x}
249+ if [ "$a" -lt "$b" ]; then
250+ FONTSIZE=${b}x${a}
251+ fi
252+ ;;
253+esac
254+
255 if [ "$VERBOSE_OUTPUT" = yes ]; then
256 verbose=
257 else
258@@ -45,7 +101,7 @@
259 else
260 FONT="/etc/console-setup/$CODESET-$FONTFACE$FONTSIZE.psf"
261 fi
262- if [ -f "$FONT" ]; then
263+ if [ -f "$FONT" ] || [ -f "$FONT.gz" ]; then
264 if type consolechars >/dev/null 2>&1; then
265 eval consolechars -v --tty=$console -f "$FONT" $verbose
266 elif type setfont >/dev/null 2>&1; then
267@@ -59,7 +115,7 @@
268 else
269 ACM="/etc/console-setup/$CHARMAP.acm"
270 fi
271- if [ -f "$ACM" ]; then
272+ if [ -f "$ACM" ] || [ -f "$ACM.gz" ]; then
273 if type consolechars >/dev/null 2>&1; then
274 eval consolechars -v --tty=$console --acm "$ACM" \
275 $verbose

Subscribers

People subscribed via source and target branches