From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OefNr-0007V6-LA for garchives@archives.gentoo.org; Fri, 30 Jul 2010 02:31:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7DC4DE0922; Fri, 30 Jul 2010 02:31:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 5E55DE08FE for ; Fri, 30 Jul 2010 02:31:32 +0000 (UTC) Received: from afta-gentoo.localnet (ip-85-198-235-97.broker.com.pl [85.198.235.97]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPSA id 5FCA41B4023 for ; Fri, 30 Jul 2010 02:31:31 +0000 (UTC) From: Arfrever Frehtes Taifersar Arahesis To: Gentoo Development Subject: Re: [gentoo-dev] Re: Locale check in python_pkg_setup() Date: Fri, 30 Jul 2010 04:32:17 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34-tuxonice-r1-AFTA; KDE/4.4.5; x86_64; ; ) References: <201007300116.43653.Arfrever@gentoo.org> <4C521920.6000206@gentoo.org> In-Reply-To: <4C521920.6000206@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2334910.HiGThs3JFa"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201007300432.18194.Arfrever@gentoo.org> X-Archives-Salt: 9bf95640-f502-4b30-b21d-fa1c35124638 X-Archives-Hash: e4a57618b3aca1ed0e98f2577de472ea --nextPart2334910.HiGThs3JFa Content-Type: multipart/mixed; boundary="Boundary-01=_xmjUM0zpyh6zUn5" Content-Transfer-Encoding: 7bit --Boundary-01=_xmjUM0zpyh6zUn5 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 2010-07-30 02:13:20 Jonathan Callen napisa=C5=82(a): > On 07/29/2010 07:16 PM, Arfrever Frehtes Taifersar Arahesis wrote: > > + locale=3D"$(python -c 'import os; print(os.environ.get("LC_ALL", os.e= nviron.get("LC_CTYPE", os.environ.get("LANG", "POSIX"))))')" > > + if [[ "${locale}" !=3D *.UTF-8 ]]; then >=20 > Shouldn't you be checking the output of `locale charmap` instead of the > actual contents of the LC_ALL/LC_CTYPE/LANG variables? You currently > are reporting an error if someone is using the "en_US.utf8" locale > (which *is* a legal UTF-8 locale, and should not be an error). OK. I will check output of `locale charmap`, but the actual locale is more = useful in error message. =2D-=20 Arfrever Frehtes Taifersar Arahesis --Boundary-01=_xmjUM0zpyh6zUn5 Content-Type: text/x-patch; charset="iso-8859-1"; name="python.eclass.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="python.eclass.patch" =2D-- python.eclass +++ python.eclass @@ -355,6 +355,8 @@ # Check if phase is pkg_setup(). [[ "${EBUILD_PHASE}" !=3D "setup" ]] && die "${FUNCNAME}() can be used on= ly in pkg_setup() phase" =20 + local locale + if [[ "$#" -ne 0 ]]; then die "${FUNCNAME}() does not accept arguments" fi @@ -407,6 +409,16 @@ unset -f python_pkg_setup_check_USE_flags fi =20 + if [[ "$(locale charmap)" !=3D "UTF-8" ]]; then + locale=3D"$(python -c 'import os; print(os.environ.get("LC_ALL", os.envi= ron.get("LC_CTYPE", os.environ.get("LANG", "POSIX"))))')" + eerror + eerror "Currently used locale '${locale}' is unsupported and can cause b= uild-time or run-time" + eerror "problems (usually UnicodeDecodeErrors or UnicodeEncodeErrors). B= ugs caused by this locale" + eerror "will be closed as invalid. It is recommended to use a UTF-8 loca= le to avoid problems." + eerror "See http://www.gentoo.org/doc/en/utf-8.xml for information on ho= w to fix locale." + eerror + fi + PYTHON_PKG_SETUP_EXECUTED=3D"1" } =20 --Boundary-01=_xmjUM0zpyh6zUn5-- --nextPart2334910.HiGThs3JFa Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iQIcBAABAgAGBQJMUjmyAAoJEFU3/w1zlLfgCIoP/RzsV6h40hpn0jK9DCbu6arJ +jhmT2VhwgZ1bDqk/uj4ri9j13hEuO8nNWadPDgUl3cCVc+RAd1S3M3OwBYs7ILQ 8kkarfaFgYT9CLLxRZjlxPtUqsU1DtO3r0QkjEoWd8ToZcRgzIySdapv3ZhYj3Wx wNDVF7ds3LxKxxBZHouKaZuPUUk9ivN2hAqr56wcXzvlmqjDSKNmflYp8YsTvidq 3CB6sybHclrY4IW293tAtHbhm8z6Wc7NdsbEJIEiyYQJCWgzuz076OKSsEldCwIX 1doOmpMqOkiWsTnc0q/PpK/j4LWoht5J3nrYZDZ2Ucque/Zov6st2mGH6bRwvWRO CcOwIJQ7VGKrMjVD1tq6VY0Mb6ep0iljD2AvGoSFN09gPU9CJ/83NwgUJLqd9JuB SeOLDiJiafW4GaO0suhfVg0ohLHJOdF04QHJ8XzNtITGsX5wuR+SuR7M8Dcn/kCo PAuV5ues5QO/ps+6YFgqD4451yHhwOSyNdRaVVxetm0jZxeoywcs+msN/zYhYH6z vR5SvvLz0i6vLPyDENimVlocegmgyv/vR2m8wf7KID2ibLi5xDgHrWs6Sl4Q4/WM mr6FV861csVq1BHEgdlOovK8dxQeSH5lpiQnP/O34BGa3/zsUpY+ypWDNn+i7VkZ Ju2CTGNUKtMxr4fsdgLi =gjbR -----END PGP SIGNATURE----- --nextPart2334910.HiGThs3JFa--