/[gentoo]/xml/htdocs/proj/en/glep/glep-0055.txt
Gentoo

Diff of /xml/htdocs/proj/en/glep/glep-0055.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1GLEP: 55 1GLEP: 55
2Title: Use EAPI-suffixed ebuilds (.ebuild-EAPI) 2Title: Use EAPI-suffixed ebuilds (.ebuild-EAPI)
3Version: $Revision: 1.1 $ 3Version: $Revision: 1.2 $
4Last-Modified: $Date: 2008/01/05 02:36:35 $ 4Last-Modified: $Date: 2008/01/06 02:39:42 $
5Author: Piotr Jaroszyński <peper@gentoo.org> 5Author: Piotr Jaroszyński <peper@gentoo.org>
6Status: Draft 6Status: Draft
7Type: Standards Track 7Type: Standards Track
8Content-Type: text/x-rst 8Content-Type: text/x-rst
9Created: 17-Dec-2007 9Created: 17-Dec-2007
26 26
27The current way of specifying the EAPI in ebuilds is flawed. In order to get the 27The current way of specifying the EAPI in ebuilds is flawed. In order to get the
28EAPI the package manager needs to source the ebuild, which itself needs the EAPI 28EAPI the package manager needs to source the ebuild, which itself needs the EAPI
29in the first place. Otherwise it imposes a serious limitation, namely every ebuild, 29in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
30using any of the future EAPIs, will have to be source'able by old package 30using any of the future EAPIs, will have to be source'able by old package
31managers and hence there is no way to: 31managers and hence there is no way to do any of the following:
32 32
33 * Change behaviour of inherit in any way (for example, to extend or change 33 * Change the behaviour of inherit in any way (for example, to extend or change
34 eclass functionality). 34 eclass functionality).
35 35
36 * Add new global scope functions in any sane way. 36 * Add new global scope functions in any sane way.
37 37
38 * Extend versioning rules in an EAPI - for example, addition of the scm 38 * Extend versioning rules in an EAPI - for example, addition of the scm
53Proposed solution 53Proposed solution
54================= 54=================
55 55
56The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This 56The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
57allows package managers to trivially read the EAPI from the ebuild filename. It 57allows package managers to trivially read the EAPI from the ebuild filename. It
58is also backward compatible, because currently ebuilds are recognised by the 58is also backwards compatible, because currently ebuilds are recognised by the
59``.ebuild`` file extension and hence EAPI-suffixed ebuilds are simply ignored by 59``.ebuild`` file extension and hence EAPI-suffixed ebuilds are simply ignored by
60the package managers. 60the package managers.
61 61
62 62
63Specification 63Specification
85in such cases. 85in such cases.
86 86
87Examples: 87Examples:
88 88
89 * ``pkg-1.ebuild``, no EAPI set inside the ebuild 89 * ``pkg-1.ebuild``, no EAPI set inside the ebuild
90 pre-source EAPI defaults 0, post-source EAPI defaults to pre-source EAPI. 90 pre-source EAPI defaults to 0, post-source EAPI defaults to pre-source EAPI.
91 EAPI 0 is used. 91 EAPI 0 is used.
92 92
93 * ``pkg-2.ebuild-1``, no EAPI set inside the ebuild 93 * ``pkg-2.ebuild-1``, no EAPI set inside the ebuild
94 pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI. 94 pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI.
95 EAPI 1 is used. 95 EAPI 1 is used.
103 EAPI 1 is used, but note that one should **never** explicitly set both 103 EAPI 1 is used, but note that one should **never** explicitly set both
104 EAPIs to different values. 104 EAPIs to different values.
105 105
106 * ``pkg-5.ebuild-2``, no EAPI set inside the ebuild, package manager not supporting EAPI 2 106 * ``pkg-5.ebuild-2``, no EAPI set inside the ebuild, package manager not supporting EAPI 2
107 pre-source EAPI is 2, post-source EAPI is never checked. 107 pre-source EAPI is 2, post-source EAPI is never checked.
108 ebuild masked because of the unsupported pre-source EAPI. 108 ebuild is masked because of the unsupported pre-source EAPI.
109 109
110 * ``pkg-6.ebuild``, ``EAPI="2"``, package manager not supporting EAPI 2 110 * ``pkg-6.ebuild``, ``EAPI="2"``, package manager not supporting EAPI 2
111 pre-source EAPI defaults to 0, post-source EAPI is 2 (assuming the 111 pre-source EAPI defaults to 0, post-source EAPI is 2 (assuming the
112 package manager didn't die when sourcing the ebuild thinking that EAPI 0 112 package manager didn't die when sourcing the ebuild thinking that EAPI 0
113 is used). 113 is used).
114 ebuild masked because of the unsupported post-source EAPI. 114 ebuild is masked because of the unsupported post-source EAPI.
115 115
116Note that it is still not permitted to have more than one ebuild with equal 116Note that it is still not permitted to have more than one ebuild with equal
117category, package name, and version. Although it would have the advantage of 117category, package name, and version. Although it would have the advantage of
118allowing to provide backward compatible ebuilds, it would introduce problems 118allowing authors to provide backwards compatible ebuilds, it would introduce
119too. The first is the requirement to have strict EAPI ordering, the second is 119problems too. The first is the requirement to have strict EAPI ordering, the
120ensuring that all the ebuilds for a single category/package-version are 120second is ensuring that all the ebuilds for a single category/package-version
121equivalent, i.e. installing any of them has exactly the same effect to the 121are equivalent, i.e. installing any of them has exactly the same effect on a
122system. 122given system.
123 123
124Application 124Application
125=========== 125===========
126 126
127Note that the developers should only set the pre-source EAPI. The process 127Note that the developers should only set the pre-source EAPI. The process
137There were some other solutions proposed on the mailing list: 137There were some other solutions proposed on the mailing list:
138 138
139 * Set the EAPI inside the ebuild in a way that makes it easy to fetch it 139 * Set the EAPI inside the ebuild in a way that makes it easy to fetch it
140 * Doesn't meet the backward compatibility requirement. 140 * Doesn't meet the backward compatibility requirement.
141 * Isn't forward compatible either. 141 * Isn't forward compatible either.
142 * Could be confusing as ebuilds, and not without a reason, are 142 * Could be confusing as ebuilds are considered bash scripts and this
143 considered bash scripts and this would impose additional restrictions. 143 would impose additional restrictions on the ebuild format.
144 144
145 * Do the above and change the ebuild extension to ``.ebuild-ng`` 145 * Do the above and change the ebuild extension to ``.ebuild-ng``
146 * Meets the backward compatibility requirement. 146 * Meets the backward compatibility requirement.
147 * Still can be confusing. 147 * Still can be confusing.
148 * Isn't really forward compatible. What would be after ``.ebuild-ng``? 148 * Isn't really forward compatible. What would be after ``.ebuild-ng``?

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20