Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/vilistextum: ChangeLog vilistextum-2.6.9.ebuild
Date: Sun, 06 Feb 2011 14:54:19
Message-Id: 20110206145409.5E49F20054@flycatcher.gentoo.org
1 grobian 11/02/06 14:54:09
2
3 Modified: ChangeLog vilistextum-2.6.9.ebuild
4 Log:
5 Search for an UTF-8 locale for people that lack en_US.UTF-8, such that we don't blindly hardcode an invalid locale to be used that causes invalid locale errors at runtime
6
7 (Portage version: 2.2.01.17693-prefix/cvs/SunOS i386)
8
9 Revision Changes Path
10 1.33 app-text/vilistextum/ChangeLog
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/ChangeLog?rev=1.33&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/ChangeLog?rev=1.33&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/ChangeLog?r1=1.32&r2=1.33
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-text/vilistextum/ChangeLog,v
19 retrieving revision 1.32
20 retrieving revision 1.33
21 diff -u -r1.32 -r1.33
22 --- ChangeLog 6 Feb 2011 14:14:51 -0000 1.32
23 +++ ChangeLog 6 Feb 2011 14:54:09 -0000 1.33
24 @@ -1,6 +1,11 @@
25 # ChangeLog for app-text/vilistextum
26 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/ChangeLog,v 1.32 2011/02/06 14:14:51 grobian Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/ChangeLog,v 1.33 2011/02/06 14:54:09 grobian Exp $
29 +
30 + 06 Feb 2011; Fabian Groffen <grobian@g.o> vilistextum-2.6.9.ebuild:
31 + Search for an UTF-8 locale for people that lack en_US.UTF-8, such that we
32 + don't blindly hardcode an invalid locale to be used that causes invalid
33 + locale errors at runtime
34
35 06 Feb 2011; Fabian Groffen <grobian@g.o> vilistextum-2.6.9.ebuild:
36 Marked ~x86-solaris
37
38
39
40 1.10 app-text/vilistextum/vilistextum-2.6.9.ebuild
41
42 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild?rev=1.10&view=markup
43 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild?rev=1.10&content-type=text/plain
44 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild?r1=1.9&r2=1.10
45
46 Index: vilistextum-2.6.9.ebuild
47 ===================================================================
48 RCS file: /var/cvsroot/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild,v
49 retrieving revision 1.9
50 retrieving revision 1.10
51 diff -u -r1.9 -r1.10
52 --- vilistextum-2.6.9.ebuild 6 Feb 2011 14:14:51 -0000 1.9
53 +++ vilistextum-2.6.9.ebuild 6 Feb 2011 14:54:09 -0000 1.10
54 @@ -1,6 +1,6 @@
55 # Copyright 1999-2011 Gentoo Foundation
56 # Distributed under the terms of the GNU General Public License v2
57 -# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild,v 1.9 2011/02/06 14:14:51 grobian Exp $
58 +# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild,v 1.10 2011/02/06 14:54:09 grobian Exp $
59
60 EAPI="2"
61
62 @@ -28,18 +28,41 @@
63 eautoreconf
64 }
65
66 +get_locale() {
67 + locale -a | grep -i "$1\.utf.*8\$"
68 +}
69 +
70 +find_locale() {
71 + local l t
72 +
73 + # we basically prefer to find en_US.UTF-8, but it may not always be
74 + # available, in which case it is better not to hardcode to use it
75 + l=$(get_locale en_US)
76 + if [[ -z ${l} ]] ; then
77 + for t in "en_.*" ".*" ; do
78 + l=$(get_locale ${t})
79 + if [[ -n ${l} ]] ; then
80 + l=${l%%$'\n'*}
81 + break;
82 + fi
83 + done
84 + fi
85 + [[ -z ${l} ]] && die "Failed to find a unicode locale"
86 + echo "${l}"
87 +}
88 +
89 src_configure() {
90 # need hardwired locale simply because locale -a | grep -i utf-8 | head -n1
91 # isn't always returning the most sensical (and working) locale
92 econf \
93 $(use_enable unicode multibyte) \
94 - $(use_with unicode unicode-locale en_US.UTF-8)
95 + $(use_with unicode unicode-locale $(find_locale))
96 }
97
98 src_test() {
99 - if $(locale -a | grep -iq en_US.utf8); then
100 - emake -j1 \
101 - check || die
102 + if $(locale -a | grep -iq "en_US\.utf.*8"); then
103 + emake -j1 \
104 + check || die
105 else
106 ewarn "If you like to run the test,"
107 ewarn "please make sure en_US.UTF-8 is installed."