1 |
On Wednesday 28 September 2005 13:19, Donnie Berkholz wrote: |
2 |
> Jason Stubbs wrote: |
3 |
> | What are the exact reasons for not wanting to put the expanded flags |
4 |
> | directly into IUSE? If it's just a matter of the horrid display existing |
5 |
> | tools would give, the functionality can go in and IUSE updated after the |
6 |
> | functional versions are stabled. Are there any reasons beyond that? |
7 |
> |
8 |
> It's useful to group things logically like this. You don't need to worry |
9 |
> about forgetting to add in variables like: |
10 |
> |
11 |
> IUSE_VIDEO_CARDS="foo bar" |
12 |
> IUSE="${IUSE_VIDEO_CARDS} baz bop" |
13 |
> |
14 |
> Particularly when you start doing things in eclasses as well as ebuilds, |
15 |
> this gets worrisome. It's also more aesthetically pleasing. And it |
16 |
> creates a logical parallel with the user-set variables in make.conf. |
17 |
|
18 |
iuse_expand() |
19 |
{ |
20 |
VAR="`echo $1 | awk '{print tolower($0)}'`" |
21 |
shift |
22 |
for FLAG in "$@"; do |
23 |
IUSE="${IUSE} ${VAR}_${FLAG}" |
24 |
done |
25 |
export IUSE |
26 |
} |
27 |
|
28 |
IUSE="baz bop" |
29 |
iuse_expand VIDEO_CARDS foo bar |
30 |
|
31 |
> In addition, it saves IUSE from having super-long flags: |
32 |
> |
33 |
> IUSE="video_cards_foo video_cards_bar video_cards_baz ... " -- picture |
34 |
> that repeated 10 times. It's just plain ugly and overly long. |
35 |
|
36 |
It doesn't save anything because internally it needs to be done that way |
37 |
regardless. The only difference between the two patches is that one has |
38 |
IUSE="..." and the other has IUSE_EXPAND="...". |
39 |
|
40 |
> Most importantly IMHO, it suggests that users should set |
41 |
> USE="video_cards_foo" instead of VIDEO_CARDS="foo". |
42 |
|
43 |
Users don't see it either way, so I can't see how it suggests anything. |
44 |
|
45 |
-- |
46 |
Jason Stubbs |
47 |
-- |
48 |
gentoo-dev@g.o mailing list |