1 |
On Mon, 12 Mar 2012 21:39:52 +1300 |
2 |
Kent Fredric <kentfredric@×××××.com> wrote: |
3 |
|
4 |
> On 12 March 2012 21:27, Michał Górny <mgorny@g.o> wrote: |
5 |
> > And we could just use a good regex for that instead. |
6 |
> > |
7 |
> > Something like: [eE][aA][pP][iI] <whitespace-or-symbols> [a-z0-9-+]+ |
8 |
> > |
9 |
> > and just require users for this to be the first thing declared in |
10 |
> > an ebuild. Of course, this could make problems with stuff like: |
11 |
> > |
12 |
> > # EAPI 4 because of foobarbaz |
13 |
> > EAPI=4 |
14 |
> > |
15 |
> > (on the other hand, in this particular case it will fetch '4' |
16 |
> > anyway). |
17 |
> > |
18 |
> > And this will work as well with: |
19 |
> > |
20 |
> > <eapi>15-xml</eapi> |
21 |
> > |
22 |
> > and |
23 |
> > |
24 |
> > - eapi: 15-yaml |
25 |
> > |
26 |
> |
27 |
> Also, remember the proposal is to read it only from the first 10-30 |
28 |
> lines of the file, and if you're *generating* YAML/XML , then this is |
29 |
> not necessarily guaranteed. |
30 |
> |
31 |
> Some generation tools emit keys in alphanumeric ordering, others |
32 |
> psuedo-randomly, and the EAPI declaration line in some formats could |
33 |
> easily be on the very last line of the file. |
34 |
|
35 |
You should ensure your tool does the right thing, I'd say. XML with DTD |
36 |
often requires specific element order, so such a tool is simply bound |
37 |
to fail with XML. |
38 |
|
39 |
For yaml, it's a fair point. |
40 |
|
41 |
-- |
42 |
Best regards, |
43 |
Michał Górny |