1 |
Hi! |
2 |
|
3 |
On Fri, 15 May 2009, Ciaran McCreesh wrote: |
4 |
> > eval `grep '^EAPI=' ebuildfile | head -n 1` |
5 |
> > |
6 |
> > will set EAPI in the current scope to EAPI in the ebuild, without |
7 |
> > sourcing it, unless the issue with something like this would be its |
8 |
> > use of grep and head, but these are both in the system set, so unless |
9 |
> > you don't want to depend on the system set, I don't know what the |
10 |
> > objection would be. |
11 |
> |
12 |
> The objection is that your code doesn't work. It's entirely legal to |
13 |
> do, say: |
14 |
> |
15 |
> export EAPI="1" |
16 |
|
17 |
Change the spec, then. Or aren't we talking about |
18 |
writing/changing/clarifying a spec right now? I mean... yes, |
19 |
ebuilds are actually bash scripts. But I don't see a problem with |
20 |
using a subset of what's allowed for *this* *specific* line. |
21 |
|
22 |
Actually, I personally would prefer taking it out of the |
23 |
parsed-by-bash part entirely. Add it as a shebang-like line at |
24 |
the top: |
25 |
|
26 |
#EAPI-1 |
27 |
|
28 |
as the first or second line. Allowing it on the second line |
29 |
allows you to later bolt on a true shebang-line if you should so |
30 |
desire. Only having to look at the first two lines makes finding |
31 |
it out easier (note that I don't call that parsing on purpose). |
32 |
|
33 |
> or: |
34 |
> |
35 |
> inherit versionator |
36 |
> |
37 |
> if version_is_at_least 2 ; then |
38 |
> EAPI="2" |
39 |
> else |
40 |
> EAPI="0" |
41 |
> fi |
42 |
|
43 |
I was under the impression that it's illegal to change/set the |
44 |
EAPI after using inherit. |
45 |
|
46 |
Regards, |
47 |
Tobias |
48 |
|
49 |
-- |
50 |
Found on a small utility knife in MIT's lab supply: |
51 |
"Caution. Blade is sharp. Keep out of children." |