Joe Peterson ha scritto:
It was mentioned that "comments are to be ignored", but you point out a
perfect and very fundamental example of where this is not true:

#!/usr/bin/env bash

Putting another line close to this one with:

#EAPI=42

or

#!EAPI=42

if you like (conforms more to the shell script specifier), is not too
muchh of a stretch.

The so-called shebang; very good in my opinion!

Works very well for true shell scripts. why it can't work for ebuilds?


First, I think of two alternatives:

1) the interpreter is the EAPI (with /usr/bin/ebuild being EAPI=0)
this will be the first line of a EAPI=0 ebuild:

   #!/usr/bin/ebuild

this will be a EAPI=paludis ebuild:

   #!/usr/bin/ebuild-paludis

apparently it's the same mechanism the shell uses to execute a shell script, except for the fact that:
*  ebuild is not an executable file
* an external program is used to determine the EAPI (i.e.: extract the shebang)


2) fixed interpreter name, use arguments for switching EAPIs

this is another option, wich carries itself a GREAT power of leaving an open door when in the future will happen something similar to what we have now, where switching the EAPI (or replace EAPI with something else) is critical and breaks compatibility.

example - EAPI=0:
   #!/usr/bin/ebuild
   ...
another eapi:
   #!/usr/bin/ebuild -eapi paludis

This allows virtually unlimited cases similar to this; for example when switching to <another-feature-that-breaks-things>, another switch will be used:

   #!/usr/bin/ebuild -eapi foo -fluffy bar



Advantages of both solutions:
* easy to parse
* doesn't break compatibility

What it does not address:
* doesn't break compatibility

In fact, it should break compatibility.
again I can think of two solutions:
1) change the ebuild extension to a different value, once and (hopefully) forever, e.g. from .ebuild to .xbuild, and leave the minimal set of .ebuild-s for the upgrade path 2) use two repositories: the legacy one, needed for the upgrade path, and the shyny-new-repository with the new ebuilds format


best regards,
Federico Ferri

--
#include <stdio.h>
main(){printf("%x",4275974592);}


-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d-(--) a- C++$ UL+++$ L+++$ E--- W++@ w--@
PE PGP+ R- tv-- DI++>+++ D++ h+
------END GEEK CODE BLOCK------


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to