-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ciaran McCreesh wrote:
> On Fri, 15 May 2009 14:43:29 -0500
> William Hubbs <[email protected]> wrote:
>> On Thu, May 14, 2009 at 10:53:37PM +0100, Ciaran McCreesh wrote:
>>> It can't, because it doesn't know the EAPI until it's sourced the
>>> thing using bash. Using things like += in global scope will break
>>> older bash versions to the point that they can't reliably extract
>>> EAPI.
>>  
>> I just figured out a line in bash that will get an EAPI without
>> sourcing the ebuild:
>>
>> eval `grep '^EAPI=' ebuildfile | head -n 1`
>>
>> will set EAPI in the current scope to EAPI in the ebuild, without
>> sourcing it, unless the issue with something like this would be its
>> use of grep and head, but these are both in the system set, so unless
>> you don't want to depend on the system set, I don't know what the
>> objection would be.
> 
> The objection is that your code doesn't work. It's entirely legal to
> do, say:
> 
>     export EAPI="1"
> 
> or:
> 
>     inherit versionator
> 
>     if version_is_at_least 2 ; then
>         EAPI="2"
>     else
>         EAPI="0"
>     fi
> 
> Besides, if we were able to do what your code does, we'd just code it
> natively, not use external programs.

How is it possible to do these things encoded in the filename?

Marijn

- --
If you cannot read my mind, then listen to what I say.

Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML
<http://www.gentoo.org/proj/en/lisp/>, #gentoo-{lisp,ml} on FreeNode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoOhxcACgkQp/VmCx0OL2wXqACfSkZVqv2hcskm7Yw7vyizeh5r
UnIAn1npT5j6CcN23WE3yG6p8WDZiF9D
=bI9e
-----END PGP SIGNATURE-----

Reply via email to