1 |
On Thu, 22 Feb 2007 22:02:27 +0100 Simon Stelling <blubb@g.o> |
2 |
wrote: |
3 |
| Ciaran McCreesh wrote: |
4 |
| > || ( |
5 |
| > sdl? ( media-libs/libsdl ) |
6 |
| > svga? ( media-libs/svgalib ) |
7 |
| > opengl? ( virtual/opengl ) |
8 |
| > ggi? ( media-libs/libggi ) |
9 |
| > virtual/x |
10 |
| > ) |
11 |
| |
12 |
| It's doable with just use. For the example above, this would be the |
13 |
| solution: |
14 |
| |
15 |
| interface="x11" |
16 |
| use ggi && interface="ggi" |
17 |
| use opengl && interface="opengl" |
18 |
| use svgalib && interface="svga" |
19 |
| use sdl && interface="libsdl" |
20 |
|
21 |
I'll explain why this doesn't work for the benefit of anyone who misses |
22 |
it... |
23 |
|
24 |
Consider the user having USE="sdl svgalib", and already having svgalib |
25 |
installed. Then sdl will not be pulled in, and the above solution will |
26 |
give the wrong interface. |
27 |
|
28 |
| > So, is there a legitimate reason for this complication to exist? Or |
29 |
| > should use? blocks being direct children of || ( ) be forbidden? |
30 |
| |
31 |
| I don't see how this is a complication, tbh. The alternative would be |
32 |
| to have the same DEPEND but without the ||(). But then you would have |
33 |
| to a) let the ebuild die if more then one flag is turned on or b) |
34 |
| have it follow the same logic as shown above. |
35 |
| |
36 |
| I also don't see how it is a nuisance to explain. Explain how ||() |
37 |
| works with a "normal" dependency, explain how use? () dependencies |
38 |
| work and it will become clear to everybody how it will work. TBH, it |
39 |
| looks to me like you were to explain how an if statement in a while |
40 |
| loop works, even though it is well-known how both of them work if |
41 |
| they aren't nested. |
42 |
|
43 |
Except that that's not what happens. The current behaviour makes if |
44 |
work differently if it's a direct child of a while loop. The following |
45 |
are not equivalent: |
46 |
|
47 |
|| ( foo? ( bar/foo ) bar/baz ) |
48 |
|
49 |
|| ( ( foo? ( bar/foo ) ) bar/baz ) |
50 |
|
51 |
The former will always require either foo or baz, whereas the latter |
52 |
will sometimes require neither. |
53 |
|
54 |
-- |
55 |
Ciaran McCreesh |
56 |
Mail : ciaranm at ciaranm.org |
57 |
Web : http://ciaranm.org/ |
58 |
Paludis, the secure package manager : http://paludis.pioto.org/ |