Gentoo Archives: gentoo-dev

From: Mounir Lamouri <volkmar@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] USE flags requirements (EAPI-4 ?)
Date: Mon, 31 Aug 2009 16:07:10
Message-Id: 4A9C3D8B.4020903@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] USE flags requirements (EAPI-4 ?) by dev-random@mail.ru
1 dev-random@××××.ru wrote:
2 > On Mon, Aug 31, 2009 at 07:27:32PM +0100, Ciaran McCreesh wrote:
3 >
4 >> Then when the user turns on all three:
5 >>
6 >> * If 'd' is enabled, if 'a' is enabled, 'b' must not be enabled
7 >> * If 'd' is enabled, if 'a' is enabled, 'c' must not be enabled
8 >> * If 'd' is enabled, if 'b' is enabled, 'a' must not be enabled
9 >> * If 'd' is enabled, if 'b' is enabled, 'c' must not be enabled
10 >> * If 'd' is enabled, if 'c' is enabled, 'a' must not be enabled
11 >> * If 'd' is enabled, if 'c' is enabled, 'b' must not be enabled
12 >>
13 >> And in the general case, there's no way of translating the latter into
14 >> the former.
15 >>
16 >> Much easier for everyone if you just say what you mean rather than
17 >> converting it into some convoluted (but theoretically equivalent) less
18 >> expressive syntax.
19 >>
20 >
21 > I suggest alternative syntax, less powerfull but more expressive:
22 > groups of use-flags.
23 >
24 > Guess we define the following flags in IUSE:
25 > 3d.nvidia 3d.ati 3d.intel
26 > or
27 > 3d+nvidia 3d+ati 3d+intel
28 > or
29 > 3d:nvidia 3d:ati 3d:intel
30 >
31 > In first case we may enable any number of those flags.
32 > In second case we must enable at least one of them.
33 > In third case we must enable exactly one of them.
34 > In all 3 cases, if (and only if) flag '3d' itself exist in IUSE,
35 > those flags are ignored when it is unset.
36 >
37 > For convenience, user may use '.' as middle-character in config in
38 > all 3 cases (or, perhaps, even omit it and everything before it),
39 > but in output of PM he will see proper character and understand
40 > dependencies between flags without any explanation in English.
41 >
42 > If we add flag which depends on nvidia (e.g. cg), we name it
43 > 3d.nvidia.cg, and it will be ignored (perhaps with warning) if flag
44 > 3d.nvidia is unset
45 As you said, it's not enough powerful. It's going to be hard if foo
46 flags depends on 3d and bar.
47 In addition, I don't think the real issues is the friendliness of the
48 syntax but the powerful aspect. Indeed, it shouldn't be shown to the
49 user and more the syntax is powerful less the user will be annoyed.
50
51 --
52 Mounir