From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8CA321384B4 for ; Wed, 11 Nov 2015 07:43:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 286D121C03A; Wed, 11 Nov 2015 07:42:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1AA8321C022 for ; Wed, 11 Nov 2015 07:42:51 +0000 (UTC) Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 4A72033E3A9 for ; Wed, 11 Nov 2015 07:42:50 +0000 (UTC) Date: Wed, 11 Nov 2015 02:42:50 -0500 From: Mike Frysinger To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] ban use of base-4 casemods in ebuilds due to locale collation instability Message-ID: <20151111074250.GX5154@vapier.lan> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20151110235311.GR5154@vapier.lan> <20151111025145.GU5154@vapier.lan> <22082.49419.148679.628538@a1i15.kph.uni-mainz.de> 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; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="YZHBoLCvxQT2MhEB" Content-Disposition: inline In-Reply-To: <22082.49419.148679.628538@a1i15.kph.uni-mainz.de> X-Archives-Salt: 8661be72-282b-42ff-823a-67b1541f9005 X-Archives-Hash: 5deb249e57c0eec8baeb8e8ef80a3f0e --YZHBoLCvxQT2MhEB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 11 Nov 2015 05:16, Ulrich Mueller wrote: > >>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote: >=20 > > Arfrever highlights these are not even safe to use. bash is locale awa= re, > > so it'll apply LC_COLLATE rules when processing the ^/, casemods. while > > you can fix this with external programs ala: > > LC_COLLATE=3DC tr ... >=20 > > you can't do it with inline code like: > > LC_COLLATE=3DC SRC_URI=3D".../${PN^^}/..." >=20 > >>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote: >=20 > > sorry, i meant char classification here (LC_CTYPE), not collation. >=20 > Shouldn't these be safe to use if the string consists purely of ASCII > characters? I mean, A-Z and a-z should be uppercase and lowercase, > respectively, in any locale? nope. it depends on the order of the chars in the locale and assumes the first is A and the last is Z. which not all do. $ echo {a..z} | LC_ALL=3Det_EE.UTF-8 sed 's:[a-z]::g' t u v w x y=20 we could do something like the classic: tolower() { tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' <<= <"$*"; } but that would still would not help with the bash builtins. -mike --YZHBoLCvxQT2MhEB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWQvF6AAoJEEFjO5/oN/WB/iYP/2+U0/qWXnaYiDhUJs7jiAZc LhupT3JU2Lx5kkifudeP5gBe0/qoolNn7Vhr9EVPEg/EIN0EZ/SW9cjc4LVVsD3u MUgB9OaGxA4z0drFglPuT02scsTFEF6fC3dpuqywob9NVzh1otQIipw6R3uSLkn8 NzrdvzJEgZXfkKViFFAD+rBrUqI9jnb4/0Fez71Czv+0r9myTDZrLFdCLnpU4Apx J9Fu8ePfWLiRyu9kydlSbBDnGOS3sFOQ5OBbnuPLhtIbYN7DV9OmSGH29B/BhCRx PIU767YzcerfskPNLW1ObrMfUrVnJrld1N3RvCH9NzbXPfogQH0djvWTIkBZKQDG rx/l3RP/Gozrm5D5ud3fiBob7lDawTtIhlHGHEP6sSHokoGor2EpOtxiiHdY5geA 1n9tXgytCTgW/V4NMeotIcrTFJIJQ0LydjOVxHLOJvcfncIewlufOUXkdVb62bD3 ZH3b28n6M6egS3fn7AkRDyujE8krEtu2aUOm5iNPgzZ8/B9dpqMX0gsgqXOcWVJ9 xjLuflPZuVQLrWEbtISuRzs4+eVy4rsrA6UByHQ8dHUlRELD9Ku7YX0xgEIUZfFq owfLTv1OfUcbyt3Haxl2y4l74uBErkJR3T7LuBMMQ8hhP3GcO972/4oY6/zUofgs mKChmpLa8qGnLztbjt82 =v83H -----END PGP SIGNATURE----- --YZHBoLCvxQT2MhEB--