Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH 2/2] EAPI 6: Enforce LC_COLLATE=C in ebuild environment
Date: Sat, 14 Nov 2015 23:55:41
Message-Id: 5647C9F4.4030607@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 2/2] EAPI 6: Enforce LC_COLLATE=C in ebuild environment by "Michał Górny"
1 On 11/14/2015 02:56 PM, Michał Górny wrote:
2 > +
3 > +
4 > +def split_LC_ALL(env):
5 > + """
6 > + Replace LC_ALL with split-up LC_* variables if it is defined.
7 > + Works on the passed environment (or settings instance).
8 > + """
9 > + lc_all = env.get("LC_ALL")
10 > + if lc_all is not None:
11 > + for c in locale_categories:
12 > + env[c] = lc_all
13 > + del env["LC_ALL"]
14 >
15
16 Due to the implementation details of the config.__del__ method, the del
17 call will have an irreversible effect on the config instance. That's
18 bad, because the same config instance is reused for other EAPIs. I think
19 the simplest solution will be to call this function on the "mydict"
20 inside the config.environ() method, since changes to "mydict" only
21 affect the result that is returned from that method.
22 --
23 Thanks,
24 Zac

Replies