On Mon, 12 Mar 2012 21:39:52 +1300 Kent Fredric <kentfred...@gmail.com> wrote:
> On 12 March 2012 21:27, Michał Górny <mgo...@gentoo.org> wrote: > > And we could just use a good regex for that instead. > > > > Something like: [eE][aA][pP][iI] <whitespace-or-symbols> [a-z0-9-+]+ > > > > and just require users for this to be the first thing declared in > > an ebuild. Of course, this could make problems with stuff like: > > > > # EAPI 4 because of foobarbaz > > EAPI=4 > > > > (on the other hand, in this particular case it will fetch '4' > > anyway). > > > > And this will work as well with: > > > > <eapi>15-xml</eapi> > > > > and > > > > - eapi: 15-yaml > > > > Also, remember the proposal is to read it only from the first 10-30 > lines of the file, and if you're *generating* YAML/XML , then this is > not necessarily guaranteed. > > Some generation tools emit keys in alphanumeric ordering, others > psuedo-randomly, and the EAPI declaration line in some formats could > easily be on the very last line of the file. You should ensure your tool does the right thing, I'd say. XML with DTD often requires specific element order, so such a tool is simply bound to fail with XML. For yaml, it's a fair point. -- Best regards, Michał Górny
signature.asc
Description: PGP signature