1 |
Fernando J. Pereda wrote: |
2 |
>> > Why can't it be in the file but readable without sourcing? |
3 |
>> > |
4 |
>> There's _no_ need to source, nor constrain like that, for a simple |
5 |
>> one-line variable, eg: |
6 |
>> $ sed -nr '/^[[:space:]]*DESCRIPTION="([^"]*)".*/ { s//\1/p;q; }' \ |
7 |
>> app-portage/autounmask/autounmask-0.21.ebuild |
8 |
>> autounmask - Unmasking packages the easy way |
9 |
>> |
10 |
>> eapi=$(sed -nr '/^[[:space:]]*EAPI="([^"]*)".*/ { s//\1/p;q; }' |
11 |
>> foo.ebuild) |
12 |
>> [[ $eapi ]] && checkAPI "$eapi" |
13 |
>> ..would do it in bash (empty if unset in ebuild) assuming the |
14 |
>> conventional EAPI="xx" format is used. Other languages can call system() |
15 |
>> easily enough. |
16 |
> |
17 |
> This is just *brillant*. Lets see how useful your solution is: |
18 |
> |
19 |
> --- 8< --- |
20 |
> # EAPI has to be set differently based upon tests on PV |
21 |
Er, why exactly? Why not just have the new version of the ebuild declare a |
22 |
new EAPI? |
23 |
> if [[ -z ${PV/?.?/} ]] ; then |
24 |
> EAPI="bar-1" |
25 |
> elif [[ -z ${PV/?.?.?/} ]] ; then |
26 |
> EAPI="0" |
27 |
> else |
28 |
> EAPI="1" |
29 |
> fi |
30 |
> --- 8< --- |
31 |
> |
32 |
> So please, no hacks. |
33 |
> |
34 |
Are you really telling me you are going to write _one_ ebuild with /that/ |
35 |
god-awful hackery in it? |
36 |
|
37 |
If a new version of an ebuild uses a different EAPI, one would have thought |
38 |
the changes to it-- to use that EAPI-- would mean a single EAPI declaration |
39 |
is enough. |
40 |
|
41 |
Sticking to a single EAPI="xx" format in the ebuild means we don't have the |
42 |
*hack* of duplicating information in the filename (and the whole |
43 |
{pre,post}src issue, QA checks for human error since this is redundant |
44 |
info) simply to avoid parsing a config file. |
45 |
|
46 |
|
47 |
-- |
48 |
gentoo-dev@g.o mailing list |