1 |
On Thursday 14 May 2009 23:53:37 Ciaran McCreesh wrote: |
2 |
> On Thu, 14 May 2009 16:49:09 -0500 |
3 |
> |
4 |
> William Hubbs <williamh@g.o> wrote: |
5 |
> > The second solution seems to be the better one because it does not go |
6 |
> > against standards. For example, we see extentions like .c, .py and |
7 |
> > .pl, instead of .c-43, .py-25 and .pl-58. There are ways within the |
8 |
> > languages to tell which version of the compiler is compiling them as |
9 |
> > needed. So, If we say that, EAPI 4, for example, requires bash-4.0, |
10 |
> > Isn't there a way the PM could find out which version of bash is being |
11 |
> > run, compare that to the EAPI, then take appropriate action? |
12 |
> |
13 |
> It can't, because it doesn't know the EAPI until it's sourced the thing |
14 |
> using bash. Using things like += in global scope will break older bash |
15 |
> versions to the point that they can't reliably extract EAPI. |
16 |
|
17 |
Trying to pull a Goebbels, eh? |
18 |
|
19 |
As I've said a few times you don't have to do something as complex as sourcing |
20 |
it. In most cases you might get lucky and have some form of caching or pre- |
21 |
parsed data available, so you don't even have to care. And in the other cases, |
22 |
assuming that we're talking about current ebuilds which are shell-ish and |
23 |
either define EAPI explicitly or can be assumed to be EAPI0 you can search |
24 |
with a simple regexp. That's so funky that it even works! |
25 |
|
26 |
So if you were a lazy Unix coder you'd just restrict the current rules a bit |
27 |
so that there's only one line starting with EAPI= allowed (or maybe you just |
28 |
take the first or last one, but that's annoying) and if no such line matches |
29 |
you can safely assume EAPI0 |
30 |
|
31 |
Maybe you're very lazy, so you explicitly forbid eclasses from setting or |
32 |
changing EAPI. That also avoids weird effects that make you lose lots of time |
33 |
for debugging because you didn't think about what would happen if foo.eclass |
34 |
set EAPI="3.14" and bar.eclass inherited later set EAPI="1" ... |
35 |
|
36 |
And magically you haven't really changed current behaviour, can get the EAPI |
37 |
without sourcing it and you can be lazy once more. Isn't it great? |