Gentoo Archives: gentoo-dev

From: "René Neumann" <lists@××××××.eu>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] ban use of base-4 casemods in ebuilds due to locale collation instability
Date: Wed, 11 Nov 2015 07:17:08
Message-Id: 5642EB63.7030708@necoro.eu
In Reply to: Re: [gentoo-dev] [RFC] ban use of base-4 casemods in ebuilds due to locale collation instability by Ulrich Mueller
1 Am 11.11.2015 um 05:16 schrieb Ulrich Mueller:
2 >>>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote:
3 >
4 >> Arfrever highlights these are not even safe to use. bash is locale aware,
5 >> so it'll apply LC_COLLATE rules when processing the ^/, casemods. while
6 >> you can fix this with external programs ala:
7 >> LC_COLLATE=C tr ...
8 >
9 >> you can't do it with inline code like:
10 >> LC_COLLATE=C SRC_URI=".../${PN^^}/..."
11 >
12 >>>>>> On Tue, 10 Nov 2015, Mike Frysinger wrote:
13 >
14 >> sorry, i meant char classification here (LC_CTYPE), not collation.
15 >
16 > Shouldn't these be safe to use if the string consists purely of ASCII
17 > characters? I mean, A-Z and a-z should be uppercase and lowercase,
18 > respectively, in any locale?
19
20 Unfortunately, no (have been bitten by this issue already some years ago):
21
22 $ echo $LC_ALL
23 tr_TR
24 $ f=i; echo ${f^^}
25 İ
26 $ f=I; echo ${f,}
27 ı
28
29 - René

Replies