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 1OecLZ-0007as-Kt for garchives@archives.gentoo.org; Thu, 29 Jul 2010 23:17:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 38DEDE0ACD; Thu, 29 Jul 2010 23:17:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0DA43E0A6F for ; Thu, 29 Jul 2010 23:16:26 +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 756051B4008 for ; Thu, 29 Jul 2010 23:16:25 +0000 (UTC) From: Arfrever Frehtes Taifersar Arahesis To: Gentoo Development Subject: [gentoo-dev] Locale check in python_pkg_setup() Date: Fri, 30 Jul 2010 01:16:42 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34-tuxonice-r1-AFTA; KDE/4.4.5; x86_64; ; ) 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="nextPart1589239.sqXQhEy3QU"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201007300116.43653.Arfrever@gentoo.org> X-Archives-Salt: b623e36d-ae30-4ccf-bd52-e84bba212a11 X-Archives-Hash: c052950dbe5d79b98c86f8b09050d4d2 --nextPart1589239.sqXQhEy3QU Content-Type: multipart/mixed; boundary="Boundary-01=_bvgUMeItIcOYWVx" Content-Transfer-Encoding: 7bit --Boundary-01=_bvgUMeItIcOYWVx Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline We received too many invalid bugs caused by unsupported locales. python_pkg= _setup() needs to check locale and print error (using eerror(), without die()), when unsupported lo= cale has been detected. =2D-=20 Arfrever Frehtes Taifersar Arahesis --Boundary-01=_bvgUMeItIcOYWVx Content-Type: text/x-patch; charset="utf-8"; 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 + locale=3D"$(python -c 'import os; print(os.environ.get("LC_ALL", os.envir= on.get("LC_CTYPE", os.environ.get("LANG", "POSIX"))))')" + if [[ "${locale}" !=3D *.UTF-8 ]]; then + 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=_bvgUMeItIcOYWVx-- --nextPart1589239.sqXQhEy3QU 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) iQIcBAABAgAGBQJMUgvbAAoJEFU3/w1zlLfgcC0QAJcscc/kPrqG2vR69LlaqG1z Tds1Ly+FrEXJP/uAhHIJkXg6+1Nbu0/HpovN02GMlLwhk6ypizMS4hlNipm3NzFe KfLbWG+iW7/MmD5SiN9ufwDWum/2LsAL12AlfoTXbnb3QnReUkLBSACc/XeK1eG5 Re8f0DMig2Atz6RaIqEiH3RtCgO1nNIxmYacLC+8g6DUaudJHqqBM14EFg9sc47i lk6DISgEYgwbqvoAaQ85RU+YWE/GV7xg+yGZpoW4cwRj/MOrVocDiTQ6p1zNJ3lF Gn+9UsSxcALMvScHqNzYfKdTDb0ByJzaryhp/OH8lqScM1mQ3uK6AR6QKHlML9T6 O8IvrQ3zBTqT990chIReIOd4JY5jcxzs8UyCtEKAIItanWtYbWK7ykBXEevjJ+Ym UP0j3OTz3TlZiGsrh9Y9qHgmzMuGn3td22RVB7epTjNsjHokJHN+QM3kflBWFzsN 4IR7ZBOuO3Ek5Sh/SYIHu7F3p8c9+vOZU5C7Ufo01rIBtYj7hkCSBD48Ayo4oaKb 9Kikhu7AjXNpqrMbTtCVPdVxeZnKEb7CC7MyFNpR1BRlwuNd+rXmda6obrmSFcKd 8uWLglPsRxHQ0TGNTYcW4pkZcnYKqlocYDjlHbiUvjUOgdUoGC1K15IdS7975u4K i/9Nf3/NX7FFMslc3HM+ =ltfL -----END PGP SIGNATURE----- --nextPart1589239.sqXQhEy3QU--