1 |
On Mon, 31 Aug 2009 20:15:37 +0200 |
2 |
Mounir Lamouri <volkmar@g.o> wrote: |
3 |
> > * at least one of a b c, possibly only if d |
4 |
> > |
5 |
> IUSE_REQUIREMENTS="d? ( || ( a b c ) )" |
6 |
|
7 |
Moderately eww... |
8 |
|
9 |
> > * exactly one of a b c, possibly only if d |
10 |
> > |
11 |
> IUSE_REQUIREMENTS="d? ( || ( a b c ) ) a ? ( -b -c ) b ? ( -a -c ) c? |
12 |
> ( -a -b )" |
13 |
|
14 |
Really eww... |
15 |
|
16 |
> > * at most one of a b c, possibly only if d |
17 |
> > |
18 |
> IUSE_REQUIREMENTS="d? ( a? ( -b -c) b? ( -a -c ) c? ( -a -b) )" |
19 |
|
20 |
Similarly eww. |
21 |
|
22 |
> > From a package manager perspective, it's much easier to give good |
23 |
> > advice to the user if we're told by the ebuild exactly what's going |
24 |
> > on. |
25 |
> |
26 |
> So I think we can satisfy all use cases with the classic Gentoo syntax |
27 |
> even if new operators could be appreciated ;) |
28 |
|
29 |
How do we translate the above into nice friendly messages for the user? |
30 |
Taking the "exactly one" case, it's much better to say to the user: |
31 |
|
32 |
* If 'd' is enabled, exactly one of 'a', 'b' or 'c' must be enabled |
33 |
|
34 |
Than: |
35 |
|
36 |
* If 'd' is enabled, at least one of 'a', 'b' or 'bc' must be |
37 |
enabled |
38 |
|
39 |
Then when the user turns on all three: |
40 |
|
41 |
* If 'd' is enabled, if 'a' is enabled, 'b' must not be enabled |
42 |
* If 'd' is enabled, if 'a' is enabled, 'c' must not be enabled |
43 |
* If 'd' is enabled, if 'b' is enabled, 'a' must not be enabled |
44 |
* If 'd' is enabled, if 'b' is enabled, 'c' must not be enabled |
45 |
* If 'd' is enabled, if 'c' is enabled, 'a' must not be enabled |
46 |
* If 'd' is enabled, if 'c' is enabled, 'b' must not be enabled |
47 |
|
48 |
And in the general case, there's no way of translating the latter into |
49 |
the former. |
50 |
|
51 |
Much easier for everyone if you just say what you mean rather than |
52 |
converting it into some convoluted (but theoretically equivalent) less |
53 |
expressive syntax. |
54 |
|
55 |
-- |
56 |
Ciaran McCreesh |