--- xml/htdocs/proj/en/glep/glep-0055.html 2009/05/17 15:50:27 1.3 +++ xml/htdocs/proj/en/glep/glep-0055.html 2009/05/17 17:00:30 1.4 @@ -11,8 +11,8 @@ /* :Author: David Goodger :Contact: goodger@users.sourceforge.net -:date: $Date: 2009/05/17 15:50:27 $ -:version: $Revision: 1.3 $ +:date: $Date: 2009/05/17 17:00:30 $ +:version: $Revision: 1.4 $ :copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the PEP HTML output of Docutils. @@ -270,9 +270,9 @@ Title:Use EAPI-suffixed ebuilds (.ebuild-EAPI) -Version:1.2 +Version:1.3 -Last-Modified:2008/01/06 02:39:42 +Last-Modified:2009/05/17 15:50:27 Author:Piotr JaroszyƄski <peper at gentoo.org> @@ -298,21 +298,22 @@
  • Incompatible change of inherit (e.g. make it look in the package dir too)
  • New global scope function
  • New version format
  • +
  • Use newer bash features
  • -
  • Abstract solution
  • -
  • Proposed solution
  • -
  • Specification
  • -
  • Summary of ideas
    @@ -341,6 +342,7 @@
  • Extend versioning rules in an EAPI - for example, addition of the scm suffix - GLEP54 [1] or allowing more sensible version formats like 1-rc1, 1-alpha etc. to match upstream more closely.
  • +
  • Use newer bash features.
  • @@ -421,9 +423,45 @@

    Not the best error message, especially if there are lots of them.

    +
    +

    Use newer bash features

    +

    |& is a new type of redirection added in bash-4. It cannot be used even in +local scope as bash still parses the whole ebuild.

    +

    sys-apps/foo-1.ebuild:

    +
    +EAPI="5"
    +
    +foo() {
    +   echo "foo" |& cat
    +}
    +
    +

    Result:

    +
    +/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: syntax error near unexpected token `&'
    +/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: ` echo "foo" |& cat'
    +*
    +* ERROR: sys-apps/foo-1 failed.
    +* Call stack:
    +*               ebuild.sh, line 1879:  Called _source_ebuild
    +*               ebuild.sh, line 1818:  Called die
    +* The specific snippet of code:
    +*      source "${EBUILD}" || die "error sourcing ebuild"
    +*  The die message:
    +*   error sourcing ebuild
    +*
    +* If you need support, post the topmost build error, and the call stack if relevant.
    +* This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
    +*                                                                                                                                                                                                       ... done!
    +
    +!!! All ebuilds that could satisfy "sys-apps/foo" have been masked.
    +!!! One of the following masked packages is required to complete your request:
    +- sys-apps/foo-1 (masked by: corruption)
    +
    +

    Again, not the best error.

    +
    -

    Abstract solution

    +

    Abstract solution

    A solution to this problem has to lift those limitations and the only way to do it is to make the EAPI of an ebuild available to the package managers in a way that doesn't require them to source the ebuild. Another important requirement is @@ -433,7 +471,7 @@ issues listed on the common portage problems page - [2] - show.

    -

    Proposed solution

    +

    Proposed solution

    The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This allows package managers to trivially read the EAPI from the ebuild filename. It is also backwards compatible, because currently ebuilds are recognised by the @@ -441,7 +479,7 @@ the package managers.

    -

    Specification

    +

    Specification

    Ebuild filename extension syntax: ebuild[-<EAPI>], where [] denotes an optional part, and <EAPI> is the EAPI of the ebuild.

    The EAPI used by the ebuild is the EAPI included in the filename if it is set. @@ -482,9 +520,9 @@ given system.

    -

    Summary of ideas

    +

    Summary of ideas

    -

    EAPI-suffixed ebuilds (proposed solution)

    +

    EAPI-suffixed ebuilds (proposed solution)

    Properties:
      @@ -496,7 +534,7 @@

      Some say it is clear and simple, others that it is ugly and unintuitive.

    -

    EAPI in the filename with one-time extension change

    +

    EAPI in the filename with one-time extension change

    One of the proposed filename formats: <PKG>-<VER>.eapi-<EAPI>.eb

    @@ -511,7 +549,7 @@

    Some say it is better because the extension is static.

    -

    Easily fetchable EAPI inside the ebuild

    +

    Easily fetchable EAPI inside the ebuild

    Properties:
      @@ -528,7 +566,7 @@ ebuild) for each available ebuild.

    -

    Easily fetchable EAPI inside the ebuild and one-time extension change

    +

    Easily fetchable EAPI inside the ebuild and one-time extension change

    Properties:
      @@ -542,7 +580,7 @@ because of the arbitrary format restrictions in what is a bash script otherwise.

    -

    References

    +

    References

    @@ -574,7 +612,7 @@
    @@ -583,7 +621,7 @@