1 |
On Sunday 16 December 2007 08:13:49 Donnie Berkholz wrote: |
2 |
> On 17:46 Fri 14 Dec , Greg Kroah-Hartman (gregkh) wrote: |
3 |
> > pkg_setup() { |
4 |
> > einfo "Checking mplayer for USE flags we need..." |
5 |
> > for f in "encode dvd x264 mp3"; do |
6 |
> > if ! built_with_use media-video/mplayer $f; then |
7 |
> > eerror "$f" |
8 |
> > die "mplayer merged without $f USE flag" |
9 |
> > fi |
10 |
> > done |
11 |
> |
12 |
> Does this actually work as you want? I'd be surprised. Quoting the whole |
13 |
> thing should treat it as a single flag with spaces and only run through |
14 |
> the loop once. |
15 |
> |
16 |
> It should only coincidentally work because built_with_use() takes any |
17 |
> number of flags and loops through them, but I doubt it prints the single |
18 |
> missing flag as you intend. |
19 |
|
20 |
Indeed it works because $f isn't quoted and built_with_use handles a list just |
21 |
fine. Just the for loop is pointless. Fixing it to check only one use flag at |
22 |
a time, however, is a horrible idea because it risks telling the user to |
23 |
recompile mplayer four times each adding another use flag. There really is no |
24 |
reason not to just show the full list of required flags if one of them is |
25 |
missing but if you really want to at least move the die out of the loop. |
26 |
|
27 |
-- |
28 |
Bo Andresen |