1 |
Thomas de Grenier de Latour wrote: |
2 |
|
3 |
> On 2007/12/18, Ciaran McCreesh <ciaran.mccreesh@×××××××××××××.uk> wrote: |
4 |
> |
5 |
>> On Mon, 17 Dec 2007 17:10:46 -0700 |
6 |
>> Joe Peterson <lavajoe@g.o> wrote: |
7 |
>> > I probably missed some of the stuff leading up to this GLEP, but |
8 |
>> > what is the problem with having the EAPI in the file and |
9 |
>> > determining it by looking at the file contents? |
10 |
>> |
11 |
>> Motivation, second bullet point: |
12 |
>> |
13 |
>> | Possibility to extend the behaviour of inherit and add new global |
14 |
>> | scope functions (as a result of not sourcing ebuilds with |
15 |
>> | unsupported EAPI). |
16 |
> |
17 |
> Why can't it be in the file but readable without sourcing? For instance, |
18 |
> it could be mandatory that EAPI=X, if present, must be the first |
19 |
> non-blank and non-comment line of the ebuild (and it would then be |
20 |
> checked after sourcing, if the ebuild is sourced, to bug on cases where |
21 |
> it's redefined or unset afterwards). |
22 |
> |
23 |
There's _no_ need to source, nor constrain like that, for a simple one-line |
24 |
variable, eg: |
25 |
$ sed -nr '/^[[:space:]]*DESCRIPTION="([^"]*)".*/ { s//\1/p;q; }' \ |
26 |
app-portage/autounmask/autounmask-0.21.ebuild |
27 |
autounmask - Unmasking packages the easy way |
28 |
|
29 |
eapi=$(sed -nr '/^[[:space:]]*EAPI="([^"]*)".*/ { s//\1/p;q; }' foo.ebuild) |
30 |
[[ $eapi ]] && checkAPI "$eapi" |
31 |
..would do it in bash (empty if unset in ebuild) assuming the conventional |
32 |
EAPI="xx" format is used. Other languages can call system() easily enough. |
33 |
|
34 |
|
35 |
-- |
36 |
gentoo-dev@g.o mailing list |