On 03/08/2012 07:03 AM, Michał Górny wrote:
Someone suggested using a standard shebang the last time this came
up, and if I remember correctly it was one of the least-disagreeable
solutions proposed. We could of course define our own custom format,
but I think something like,
#!/usr/bin/eapi5
would be perfect if we could hand off the interpretation of the
ebuild to that program. That solves the problem with new bash
features, too, since you could point that command at a specific
version.
And what would /usr/bin/eapi5 do? Are you suggesting misusing shebang
or making ebuilds PM-centric?
I was saying that I'd prefer a more-standard use of the shebang (if
possible), rather than defining our own header comment syntax. Either
way I think the second option is cleaner than regular expressions.
Right now, we're guaranteed the features of bash-3.2. I guess we
actually use whatever is executing ebuild.sh to source them. But we need
to interpret the ebuild file with something: we might as well put *that*
in the shebang, since that's what it's for.
So if we were to do this with an ebuild right now, we'd add,
#!/usr/bin/eapi4
to the header, and instead of sourcing the ebuild with whatever
ebuild.sh is using, we would run it with 'eapi4' and pass whatever we
need back and forth. Or maybe ebuild.sh would reload itself using
'eapi4'. If any of that makes sense, the PMS would just need to specify
some requirements on the shebang command.