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