diff options
author | Fabian Groffen <grobian@gentoo.org> | 2011-02-06 14:54:09 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2011-02-06 14:54:09 +0000 |
commit | 19519598ed3a7e7454d31a60e29e47578c7dc287 (patch) | |
tree | 81d8762188cdb87c3274defbe813313f7c22240b /app-text/vilistextum | |
parent | Version bump and remove old - beta version. (diff) | |
download | gentoo-2-19519598ed3a7e7454d31a60e29e47578c7dc287.tar.gz gentoo-2-19519598ed3a7e7454d31a60e29e47578c7dc287.tar.bz2 gentoo-2-19519598ed3a7e7454d31a60e29e47578c7dc287.zip |
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
(Portage version: 2.2.01.17693-prefix/cvs/SunOS i386)
Diffstat (limited to 'app-text/vilistextum')
-rw-r--r-- | app-text/vilistextum/ChangeLog | 7 | ||||
-rw-r--r-- | app-text/vilistextum/vilistextum-2.6.9.ebuild | 33 |
2 files changed, 34 insertions, 6 deletions
diff --git a/app-text/vilistextum/ChangeLog b/app-text/vilistextum/ChangeLog index d193b335e1e9..4ea406f5de1b 100644 --- a/app-text/vilistextum/ChangeLog +++ b/app-text/vilistextum/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for app-text/vilistextum # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/ChangeLog,v 1.32 2011/02/06 14:14:51 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/ChangeLog,v 1.33 2011/02/06 14:54:09 grobian Exp $ + + 06 Feb 2011; Fabian Groffen <grobian@gentoo.org> vilistextum-2.6.9.ebuild: + 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 06 Feb 2011; Fabian Groffen <grobian@gentoo.org> vilistextum-2.6.9.ebuild: Marked ~x86-solaris diff --git a/app-text/vilistextum/vilistextum-2.6.9.ebuild b/app-text/vilistextum/vilistextum-2.6.9.ebuild index 31a144009d1b..51e03ecfb7ba 100644 --- a/app-text/vilistextum/vilistextum-2.6.9.ebuild +++ b/app-text/vilistextum/vilistextum-2.6.9.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild,v 1.9 2011/02/06 14:14:51 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/vilistextum/vilistextum-2.6.9.ebuild,v 1.10 2011/02/06 14:54:09 grobian Exp $ EAPI="2" @@ -28,18 +28,41 @@ src_prepare() { eautoreconf } +get_locale() { + locale -a | grep -i "$1\.utf.*8\$" +} + +find_locale() { + local l t + + # we basically prefer to find en_US.UTF-8, but it may not always be + # available, in which case it is better not to hardcode to use it + l=$(get_locale en_US) + if [[ -z ${l} ]] ; then + for t in "en_.*" ".*" ; do + l=$(get_locale ${t}) + if [[ -n ${l} ]] ; then + l=${l%%$'\n'*} + break; + fi + done + fi + [[ -z ${l} ]] && die "Failed to find a unicode locale" + echo "${l}" +} + src_configure() { # need hardwired locale simply because locale -a | grep -i utf-8 | head -n1 # isn't always returning the most sensical (and working) locale econf \ $(use_enable unicode multibyte) \ - $(use_with unicode unicode-locale en_US.UTF-8) + $(use_with unicode unicode-locale $(find_locale)) } src_test() { - if $(locale -a | grep -iq en_US.utf8); then - emake -j1 \ - check || die + if $(locale -a | grep -iq "en_US\.utf.*8"); then + emake -j1 \ + check || die else ewarn "If you like to run the test," ewarn "please make sure en_US.UTF-8 is installed." |