1 |
Author: zzam |
2 |
Date: 2008-07-30 13:54:36 +0000 (Wed, 30 Jul 2008) |
3 |
New Revision: 638 |
4 |
|
5 |
Modified: |
6 |
gentoo-vdr-scripts/trunk/ChangeLog |
7 |
gentoo-vdr-scripts/trunk/usr/share/vdr/rcscript/pre-start-45-locales.sh |
8 |
Log: |
9 |
Check locale setup as does all users of it, checking LC_ALL LC_CTYPE LANG. Improved log output of locale setup. |
10 |
|
11 |
Modified: gentoo-vdr-scripts/trunk/ChangeLog |
12 |
=================================================================== |
13 |
--- gentoo-vdr-scripts/trunk/ChangeLog 2008-07-29 22:25:47 UTC (rev 637) |
14 |
+++ gentoo-vdr-scripts/trunk/ChangeLog 2008-07-30 13:54:36 UTC (rev 638) |
15 |
@@ -1,6 +1,11 @@ |
16 |
# ChangeLog for gentoo-vdr-scripts |
17 |
# $Id$ |
18 |
|
19 |
+ 30 Jul 2008; Matthias Schwarzott <zzam@g.o> |
20 |
+ usr/share/vdr/rcscript/pre-start-45-locales.sh: |
21 |
+ Check locale setup as does all users of it, checking LC_ALL LC_CTYPE LANG. |
22 |
+ Improved log output of locale setup. |
23 |
+ |
24 |
29 Jul 2008; Matthias Schwarzott <zzam@g.o> |
25 |
usr/share/vdr/rcscript/pre-start-45-locales.sh: |
26 |
Tried to improve messages of locale handling code. Removed LC_MESSAGES=C |
27 |
|
28 |
Modified: gentoo-vdr-scripts/trunk/usr/share/vdr/rcscript/pre-start-45-locales.sh |
29 |
=================================================================== |
30 |
--- gentoo-vdr-scripts/trunk/usr/share/vdr/rcscript/pre-start-45-locales.sh 2008-07-29 22:25:47 UTC (rev 637) |
31 |
+++ gentoo-vdr-scripts/trunk/usr/share/vdr/rcscript/pre-start-45-locales.sh 2008-07-30 13:54:36 UTC (rev 638) |
32 |
@@ -29,16 +29,35 @@ |
33 |
if [ "${charmap}" = "ANSI_X3.4-1968" ]; then |
34 |
# User has not set any locale stuff |
35 |
|
36 |
- ewarn "Your locale selects an ASCII only charmap." |
37 |
- if [ -n "${LANG}" ]; then |
38 |
- ewarn "It seems the locale you chose does not exist on your system [LANG=${LANG}]" |
39 |
- ewarn "Please have a look at /etc/locale.gen" |
40 |
+ locale _ctype= _var= |
41 |
+ if [ -n "${LC_ALL}" ]; then |
42 |
+ _var=LC_ALL |
43 |
+ elif [ -n "${LC_CTYPE}" ]; then |
44 |
+ _var=LC_CTYPE |
45 |
else |
46 |
- ewarn "You have not set a charmap!" |
47 |
- ewarn "Set LANG in either /etc/env.d/02locale or /etc/conf.d/vdr" |
48 |
- ewarn "Depending on your version of baselayout only /etc/conf.d/vdr may work" |
49 |
+ _var=LANG |
50 |
fi |
51 |
|
52 |
+ eval _ctype=\$$_var |
53 |
+ if [ -n "${_ctype}" ]; then |
54 |
+ ewarn "You set ${_var}=${_ctype}" |
55 |
+ |
56 |
+ if locale -a | fgrep -x -q "${_ctype}"; then |
57 |
+ ewarn "This locale wants to use just ASCII chars - this should not happen!" |
58 |
+ else |
59 |
+ ewarn "This locale does not exist on your system" |
60 |
+ ewarn "Please have a look at /etc/locale.gen" |
61 |
+ fi |
62 |
+ else |
63 |
+ ewarn "You have not set a locale/charmap!" |
64 |
+ ewarn "Please set LANG in /etc/conf.d/vdr" |
65 |
+ |
66 |
+ if [ ! -e /lib/librc.so ]; then |
67 |
+ # baselayout1 |
68 |
+ ewarn "or do this system-wide in /etc/env.d/02locale" |
69 |
+ fi |
70 |
+ fi |
71 |
+ |
72 |
# Lets guess |
73 |
|
74 |
# try an english utf8 locale first |
75 |
@@ -52,9 +71,9 @@ |
76 |
|
77 |
if [ "${l}" != "" ]; then |
78 |
export LANG="${l}" |
79 |
- ewarn "Automatically using locale ${l} to get most of vdr utf8 support." |
80 |
+ einfo "Auto-selected locale: ${l}" |
81 |
else |
82 |
- ewarn "Not found any utf8 locale, you will have problems with chars extending ASCII" |
83 |
+ ewarn "Did not find an utf8 locale. You may have problems with non-ASCII characters" |
84 |
fi |
85 |
|
86 |
fi |