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

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

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

Revision 1.2 Revision 1.3
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 4
5<head> 5<head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> 7 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
8 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title> 8 <title>GLEP 55 -- Use EAPI-suffixed ebuilds (.ebuild-EAPI)</title>
9 <link rel="stylesheet" href="tools/glep.css" type="text/css" /> 9 <style type="text/css">
10</head> 10
11/*
12:Author: David Goodger
13:Contact: goodger@users.sourceforge.net
14:date: $Date: 2009/05/17 15:50:27 $
15:version: $Revision: 1.3 $
16:copyright: This stylesheet has been placed in the public domain.
17
18Default cascading style sheet for the PEP HTML output of Docutils.
19*/
20
21.first {
22 margin-top: 0 }
23
24.last {
25 margin-bottom: 0 }
26
27.navigation {
28 width: 100% ;
29 background: #cc99ff ;
30 margin-top: 0px ;
31 margin-bottom: 0px }
32
33.navigation .navicon {
34 width: 150px ;
35 height: 35px }
36
37.navigation .textlinks {
38 padding-left: 1em ;
39 text-align: left }
40
41.navigation td, .navigation th {
42 padding-left: 0em ;
43 padding-right: 0em ;
44 vertical-align: middle }
45
46.rfc2822 {
47 margin-top: 0.5em ;
48 margin-left: 0.5em ;
49 margin-right: 0.5em ;
50 margin-bottom: 0em }
51
52.rfc2822 td {
53 text-align: left }
54
55.rfc2822 th.field-name {
56 text-align: right ;
57 font-family: sans-serif ;
58 padding-right: 0.5em ;
59 font-weight: bold ;
60 margin-bottom: 0em }
61
62a.toc-backref {
63 text-decoration: none ;
64 color: black }
65
66body {
67 margin: 0px ;
68 margin-bottom: 1em ;
69 padding: 0px }
70
71dd {
72 margin-bottom: 0.5em }
73
74div.section {
75 margin-left: 1em ;
76 margin-right: 1em ;
77 margin-bottom: 1.5em }
78
79div.section div.section {
80 margin-left: 0em ;
81 margin-right: 0em ;
82 margin-top: 1.5em }
83
84div.abstract {
85 margin: 2em 5em }
86
87div.abstract p.topic-title {
88 font-weight: bold ;
89 text-align: center }
90
91div.attention, div.caution, div.danger, div.error, div.hint,
92div.important, div.note, div.tip, div.warning {
93 margin: 2em ;
94 border: medium outset ;
95 padding: 1em }
96
97div.attention p.admonition-title, div.caution p.admonition-title,
98div.danger p.admonition-title, div.error p.admonition-title,
99div.warning p.admonition-title {
100 color: red ;
101 font-weight: bold ;
102 font-family: sans-serif }
103
104div.hint p.admonition-title, div.important p.admonition-title,
105div.note p.admonition-title, div.tip p.admonition-title {
106 font-weight: bold ;
107 font-family: sans-serif }
108
109div.figure {
110 margin-left: 2em }
111
112div.footer, div.header {
113 font-size: smaller }
114
115div.footer {
116 margin-left: 1em ;
117 margin-right: 1em }
118
119div.system-messages {
120 margin: 5em }
121
122div.system-messages h1 {
123 color: red }
124
125div.system-message {
126 border: medium outset ;
127 padding: 1em }
128
129div.system-message p.system-message-title {
130 color: red ;
131 font-weight: bold }
132
133div.topic {
134 margin: 2em }
135
136h1 {
137 font-family: sans-serif ;
138 font-size: large }
139
140h2 {
141 font-family: sans-serif ;
142 font-size: medium }
143
144h3 {
145 font-family: sans-serif ;
146 font-size: small }
147
148h4 {
149 font-family: sans-serif ;
150 font-style: italic ;
151 font-size: small }
152
153h5 {
154 font-family: sans-serif;
155 font-size: x-small }
156
157h6 {
158 font-family: sans-serif;
159 font-style: italic ;
160 font-size: x-small }
161
162.section hr {
163 width: 75% }
164
165ol.simple, ul.simple {
166 margin-bottom: 1em }
167
168ol.arabic {
169 list-style: decimal }
170
171ol.loweralpha {
172 list-style: lower-alpha }
173
174ol.upperalpha {
175 list-style: upper-alpha }
176
177ol.lowerroman {
178 list-style: lower-roman }
179
180ol.upperroman {
181 list-style: upper-roman }
182
183p.caption {
184 font-style: italic }
185
186p.credits {
187 font-style: italic ;
188 font-size: smaller }
189
190p.label {
191 white-space: nowrap }
192
193p.topic-title {
194 font-family: sans-serif ;
195 font-weight: bold }
196
197pre.line-block {
198 font-family: serif ;
199 font-size: 100% }
200
201pre.literal-block, pre.doctest-block {
202 margin-left: 2em ;
203 margin-right: 2em ;
204 background-color: #eeeeee }
205
206span.classifier {
207 font-family: sans-serif ;
208 font-style: oblique }
209
210span.classifier-delimiter {
211 font-family: sans-serif ;
212 font-weight: bold }
213
214span.interpreted {
215 font-family: sans-serif }
216
217span.option-argument {
218 font-style: italic }
219
220span.pre {
221 white-space: pre }
222
223span.problematic {
224 color: red }
225
226table {
227 margin-top: 0.5em ;
228 margin-bottom: 0.5em }
229
230td, th {
231 padding-left: 0.5em ;
232 padding-right: 0.5em ;
233 vertical-align: top }
234
235td.num {
236 text-align: right }
237
238th.field-name {
239 font-weight: bold ;
240 text-align: left ;
241 white-space: nowrap }
242
243h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
244 font-size: 100% }
245
246tt {
247 background-color: #eeeeee }
248
249ul.auto-toc {
250 list-style-type: none }
251
252</style></head>
11<body bgcolor="white"> 253<body bgcolor="white">
12<table class="navigation" cellpadding="0" cellspacing="0" 254<table class="navigation" cellpadding="0" cellspacing="0"
13 width="100%" border="0"> 255 width="100%" border="0">
14<tr><td class="navicon" width="150" height="35"> 256<tr><td class="navicon" width="150" height="35">
15<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page"> 257<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
26<tbody valign="top"> 268<tbody valign="top">
27<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td> 269<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
28</tr> 270</tr>
29<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td> 271<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
30</tr> 272</tr>
31<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.1</td> 273<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.2</td>
32</tr> 274</tr>
33<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/proj/en/glep/glep-0055.txt?cvsroot=gentoo">2008/01/05 02:36:35</a></td> 275<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/proj/en/glep/glep-0055.txt?cvsroot=gentoo">2008/01/06 02:39:42</a></td>
34</tr> 276</tr>
35<tr class="field"><th class="field-name">Author:</th><td class="field-body">Piotr Jaroszyński &lt;peper&#32;&#97;t&#32;gentoo.org&gt;</td> 277<tr class="field"><th class="field-name">Author:</th><td class="field-body">Piotr Jaroszyński &lt;peper&#32;&#97;t&#32;gentoo.org&gt;</td>
36</tr> 278</tr>
37<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td> 279<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
38</tr> 280</tr>
39<tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td> 281<tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
40</tr> 282</tr>
41<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="glep-0002.html">text/x-rst</a></td> 283<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference external" href="glep-0002.html">text/x-rst</a></td>
42</tr> 284</tr>
43<tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td> 285<tr class="field"><th class="field-name">Created:</th><td class="field-body">17-Dec-2007</td>
44</tr> 286</tr>
45<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007</td> 287<tr class="field"><th class="field-name">Post-History:</th><td class="field-body">17-Dec-2007, 22-Dec-2007, 17-May-2009</td>
46</tr> 288</tr>
47</tbody> 289</tbody>
48</table> 290</table>
49<hr /> 291<hr />
50<div class="contents topic"> 292<div class="contents topic" id="contents">
51<p class="topic-title first"><a id="contents" name="contents">Contents</a></p> 293<p class="topic-title first">Contents</p>
52<ul class="simple"> 294<ul class="simple">
53<li><a class="reference" href="#abstract" id="id3" name="id3">Abstract</a></li> 295<li><a class="reference internal" href="#abstract" id="id3">Abstract</a></li>
54<li><a class="reference" href="#problem" id="id4" name="id4">Problem</a></li> 296<li><a class="reference internal" href="#problem" id="id4">Problem</a></li>
297<li><a class="reference internal" href="#current-behaviour" id="id5">Current behaviour</a><ul>
298<li><a class="reference internal" href="#incompatible-change-of-inherit-e-g-make-it-look-in-the-package-dir-too" id="id6">Incompatible change of inherit (e.g. make it look in the package dir too)</a></li>
299<li><a class="reference internal" href="#new-global-scope-function" id="id7">New global scope function</a></li>
300<li><a class="reference internal" href="#new-version-format" id="id8">New version format</a></li>
301</ul>
302</li>
55<li><a class="reference" href="#abstract-solution" id="id5" name="id5">Abstract solution</a></li> 303<li><a class="reference internal" href="#abstract-solution" id="id9">Abstract solution</a></li>
56<li><a class="reference" href="#proposed-solution" id="id6" name="id6">Proposed solution</a></li> 304<li><a class="reference internal" href="#proposed-solution" id="id10">Proposed solution</a></li>
57<li><a class="reference" href="#specification" id="id7" name="id7">Specification</a></li> 305<li><a class="reference internal" href="#specification" id="id11">Specification</a></li>
58<li><a class="reference" href="#application" id="id8" name="id8">Application</a></li> 306<li><a class="reference internal" href="#summary-of-ideas" id="id12">Summary of ideas</a><ul>
59<li><a class="reference" href="#other-ideas" id="id9" name="id9">Other ideas</a></li> 307<li><a class="reference internal" href="#eapi-suffixed-ebuilds-proposed-solution" id="id13">EAPI-suffixed ebuilds (proposed solution)</a></li>
308<li><a class="reference internal" href="#eapi-in-the-filename-with-one-time-extension-change" id="id14">EAPI in the filename with one-time extension change</a></li>
309<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild" id="id15">Easily fetchable EAPI inside the ebuild</a></li>
310<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change" id="id16">Easily fetchable EAPI inside the ebuild and one-time extension change</a></li>
311<li><a class="reference internal" href="#use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix" id="id17">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></li>
312</ul>
313</li>
60<li><a class="reference" href="#references" id="id10" name="id10">References</a></li> 314<li><a class="reference internal" href="#references" id="id18">References</a></li>
61<li><a class="reference" href="#copyright" id="id11" name="id11">Copyright</a></li> 315<li><a class="reference internal" href="#copyright" id="id19">Copyright</a></li>
62</ul> 316</ul>
63</div> 317</div>
64<blockquote> 318<blockquote>
65<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian 319<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
66spring: there shallow draughts intoxicate the brain, and drinking largely 320spring: there shallow draughts intoxicate the brain, and drinking largely
67sobers us again.&quot;</p> 321sobers us again.&quot;</p>
68<p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p> 322<p class="attribution">&mdash;Alexander Pope, An Essay on Criticism</p>
69</blockquote> 323</blockquote>
70<div class="section"> 324<div class="section" id="abstract">
71<h1><a class="toc-backref" href="#id3" id="abstract" name="abstract">Abstract</a></h1> 325<h1><a class="toc-backref" href="#id3">Abstract</a></h1>
72<p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for 326<p>This GLEP proposes usage of EAPI-suffixed file extensions for ebuilds (for
73example, foo-1.2.3.ebuild-1).</p> 327example, foo-1.2.3.ebuild-1).</p>
74</div> 328</div>
75<div class="section"> 329<div class="section" id="problem">
76<h1><a class="toc-backref" href="#id4" id="problem" name="problem">Problem</a></h1> 330<h1><a class="toc-backref" href="#id4">Problem</a></h1>
77<p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the 331<p>The current way of specifying the EAPI in ebuilds is flawed. In order to get the
78EAPI the package manager needs to source the ebuild, which itself needs the EAPI 332EAPI the package manager needs to source the ebuild, which itself needs the EAPI
79in the first place. Otherwise it imposes a serious limitation, namely every ebuild, 333in the first place. Otherwise it imposes a serious limitation, namely every ebuild,
80using any of the future EAPIs, will have to be source'able by old package 334using any of the future EAPIs, will have to be source'able by old package
81managers and hence there is no way to do any of the following:</p> 335managers and hence there is no way to do any of the following:</p>
83<ul class="simple"> 337<ul class="simple">
84<li>Change the behaviour of inherit in any way (for example, to extend or change 338<li>Change the behaviour of inherit in any way (for example, to extend or change
85eclass functionality).</li> 339eclass functionality).</li>
86<li>Add new global scope functions in any sane way.</li> 340<li>Add new global scope functions in any sane way.</li>
87<li>Extend versioning rules in an EAPI - for example, addition of the scm 341<li>Extend versioning rules in an EAPI - for example, addition of the scm
88suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1" name="id1">[1]</a>.</li> 342suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1">[1]</a> or allowing more sensible version formats like
343<tt class="docutils literal"><span class="pre">1-rc1</span></tt>, <tt class="docutils literal"><span class="pre">1-alpha</span></tt> etc. to match upstream more closely.</li>
89</ul> 344</ul>
90</blockquote> 345</blockquote>
91</div> 346</div>
92<div class="section"> 347<div class="section" id="current-behaviour">
93<h1><a class="toc-backref" href="#id5" id="abstract-solution" name="abstract-solution">Abstract solution</a></h1> 348<h1><a class="toc-backref" href="#id5">Current behaviour</a></h1>
349<p>Following subsections show what happens if you introduce any of the mentioned
350changes in an ebuild and try to install it with portage 2.1.6.13.</p>
351<div class="section" id="incompatible-change-of-inherit-e-g-make-it-look-in-the-package-dir-too">
352<h2><a class="toc-backref" href="#id6">Incompatible change of inherit (e.g. make it look in the package dir too)</a></h2>
353<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
354<pre class="literal-block">
355EAPI=&quot;5&quot;
356inherit &quot;foo&quot;
357
358DESCRIPTION=&quot;&quot;
359HOMEPAGE=&quot;&quot;
360SRC_URI=&quot;&quot;
361...
362</pre>
363<p>Result:</p>
364<pre class="literal-block">
365*
366* ERROR: sys-apps/foo-1 failed.
367* Call stack:
368* ebuild.sh, line 1879: Called _source_ebuild
369* ebuild.sh, line 1818: Called source '/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild'
370* foo-1.ebuild, line 6: Called inherit 'foo'
371* ebuild.sh, line 1218: Called die
372* The specific snippet of code:
373* [ ! -e &quot;$location&quot; ] &amp;&amp; die &quot;${1}.eclass could not be found by inherit()&quot;
374* The die message:
375* foo.eclass could not be found by inherit()
376*
377* If you need support, post the topmost build error, and the call stack if relevant.
378* This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
379*
380
381!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
382!!! One of the following masked packages is required to complete your request:
383- sys-apps/foo-1 (masked by: corruption)
384</pre>
385<p>Current portage looks for eclasses only in the <tt class="docutils literal"><span class="pre">eclass</span></tt> directory of a
386repository. This results in a fatal error and ebuild being masked by corruption
387- might be pretty confusing to users.</p>
388</div>
389<div class="section" id="new-global-scope-function">
390<h2><a class="toc-backref" href="#id7">New global scope function</a></h2>
391<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
392<pre class="literal-block">
393EAPI=&quot;5&quot;
394new_global_scope_function &quot;foo&quot;
395
396DESCRIPTION=&quot;&quot;
397HOMEPAGE=&quot;&quot;
398SRC_URI=&quot;&quot;
399...
400</pre>
401<p>Result:</p>
402<pre class="literal-block">
403/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 7: new_global_scope_function: command not found
404
405!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
406!!! One of the following masked packages is required to complete your request:
407- sys-apps/foo-1 (masked by: EAPI 5)
408
409The current version of portage supports EAPI '2'. You must upgrade to a
410newer version of portage before EAPI masked packages can be installed.
411</pre>
412<p>Not that bad as user is advised to upgrade portage.</p>
413</div>
414<div class="section" id="new-version-format">
415<h2><a class="toc-backref" href="#id8">New version format</a></h2>
416<p><tt class="docutils literal"><span class="pre">sys-apps/foo-2-rc1.ebuild</span></tt>:</p>
417<pre class="literal-block">
418Invalid ebuild name: /var/lib/gentoo/repositories/peper/sys-apps/foo/foo-2-rc1.ebuild
419
420emerge: there are no ebuilds to satisfy &quot;sys-apps/foo&quot;
421</pre>
422<p>Not the best error message, especially if there are lots of them.</p>
423</div>
424</div>
425<div class="section" id="abstract-solution">
426<h1><a class="toc-backref" href="#id9">Abstract solution</a></h1>
94<p>A solution to this problem has to lift those limitations and the only way to do 427<p>A solution to this problem has to lift those limitations and the only way to do
95it is to make the EAPI of an ebuild available to the package managers in a way 428it is to make the EAPI of an ebuild available to the package managers in a way
96that doesn't require them to source the ebuild. Another important requirement is 429that doesn't require them to source the ebuild. Another important requirement is
97for the solution to be backward compatible, which has the pleasant side-effect 430for the solution to be backward compatible, which has the pleasant side-effect
98of making the solution applicable in the Gentoo tree right away. Opposed to 431of making the solution applicable in the Gentoo tree right away. Opposed to
99waiting an arbitrary amount of time, which is never long enough anyway, as the 432waiting an arbitrary amount of time, which is never long enough anyway, as the
100issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2" name="id2">[2]</a> - show.</p> 433issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2">[2]</a> - show.</p>
101</div> 434</div>
102<div class="section"> 435<div class="section" id="proposed-solution">
103<h1><a class="toc-backref" href="#id6" id="proposed-solution" name="proposed-solution">Proposed solution</a></h1> 436<h1><a class="toc-backref" href="#id10">Proposed solution</a></h1>
104<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This 437<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
105allows package managers to trivially read the EAPI from the ebuild filename. It 438allows package managers to trivially read the EAPI from the ebuild filename. It
106is also backwards compatible, because currently ebuilds are recognised by the 439is also backwards compatible, because currently ebuilds are recognised by the
107<tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by 440<tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by
108the package managers.</p> 441the package managers.</p>
109</div> 442</div>
110<div class="section"> 443<div class="section" id="specification">
111<h1><a class="toc-backref" href="#id7" id="specification" name="specification">Specification</a></h1> 444<h1><a class="toc-backref" href="#id11">Specification</a></h1>
112<p>Ebuild filename extension syntax: <tt class="docutils literal"><span class="pre">ebuild[-&lt;EAPI&gt;]</span></tt>, where <tt class="docutils literal"><span class="pre">[]</span></tt> denotes an 445<p>Ebuild filename extension syntax: <tt class="docutils literal"><span class="pre">ebuild[-&lt;EAPI&gt;]</span></tt>, where <tt class="docutils literal"><span class="pre">[]</span></tt> denotes an
113optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p> 446optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p>
114<p>Let's call the EAPI included in the ebuild filename the pre-source EAPI, and the 447<p>The EAPI used by the ebuild is the EAPI included in the filename if it is set.
115EAPI set inside the ebuild the post-source EAPI. Given these two, the final EAPI 448Otherwise the EAPI set inside the ebuild is used, which defaults to 0 (this is
116used by the ebuild can be established by following these steps:</p> 449the current behaviour).</p>
117<blockquote>
118<ul class="simple">
119<li>If the pre-source EAPI is not set it defaults to 0.</li>
120<li>If the pre-source EAPI is not recognised it is returned immediately.</li>
121<li>If the post-source EAPI is not set, it defaults to the pre-source EAPI.</li>
122<li>post-source EAPI is returned.</li>
123</ul>
124</blockquote>
125<p>The above process should be only used to generate the metadata cache. Should the
126pre-source EAPI be unsupported the cache entry cannot be generated.</p>
127<p>Ebuilds with unsupported EAPIs are masked.</p> 450<p>Ebuilds with unsupported EAPIs are masked.</p>
128<p>QA tools should consider it an error for both EAPIs to be set explicitly to 451<p>It should be considered an error to set the EAPI both in the filename and in the
129different values. Package managers may warn, but must use the post-source EAPI 452ebuild.</p>
130in such cases.</p>
131<p>Examples:</p> 453<p>Examples:</p>
132<blockquote> 454<blockquote>
133<ul> 455<ul>
134<li><dl class="first docutils"> 456<li><dl class="first docutils">
135<dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt> 457<dt><tt class="docutils literal"><span class="pre">pkg-1.ebuild</span></tt>, no EAPI set inside the ebuild</dt>
136<dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI defaults to pre-source EAPI. 458<dd><p class="first last">EAPI defaults to 0.</p>
137EAPI 0 is used.</p>
138</dd> 459</dd>
139</dl> 460</dl>
140</li> 461</li>
141<li><dl class="first docutils"> 462<li><dl class="first docutils">
142<dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt> 463<dt><tt class="docutils literal"><span class="pre">pkg-2.ebuild-1</span></tt>, no EAPI set inside the ebuild</dt>
143<dd><p class="first last">pre-source EAPI is 1, post-source EAPI defaults to pre-source EAPI. 464<dd><p class="first last">EAPI 1 is used.</p>
144EAPI 1 is used.</p>
145</dd> 465</dd>
146</dl> 466</dl>
147</li> 467</li>
148<li><dl class="first docutils"> 468<li><dl class="first docutils">
149<dt><tt class="docutils literal"><span class="pre">pkg-3.ebuild</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt> 469<dt><tt class="docutils literal"><span class="pre">pkg-3.ebuild-1</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt>
150<dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 1. 470<dd><p class="first last">EAPI set in both places - error.</p>
151EAPI 1 is used.</p>
152</dd>
153</dl>
154</li>
155<li><dl class="first docutils">
156<dt><tt class="docutils literal"><span class="pre">pkg-4.ebuild-2</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;1&quot;</span></tt></dt>
157<dd><p class="first last">pre-source EAPI is 2, post-source EAPI is 1.
158EAPI 1 is used, but note that one should <strong>never</strong> explicitly set both
159EAPIs to different values.</p>
160</dd>
161</dl>
162</li>
163<li><dl class="first docutils">
164<dt><tt class="docutils literal"><span class="pre">pkg-5.ebuild-2</span></tt>, no EAPI set inside the ebuild, package manager not supporting EAPI 2</dt>
165<dd><p class="first last">pre-source EAPI is 2, post-source EAPI is never checked.
166ebuild is masked because of the unsupported pre-source EAPI.</p>
167</dd>
168</dl>
169</li>
170<li><dl class="first docutils">
171<dt><tt class="docutils literal"><span class="pre">pkg-6.ebuild</span></tt>, <tt class="docutils literal"><span class="pre">EAPI=&quot;2&quot;</span></tt>, package manager not supporting EAPI 2</dt>
172<dd><p class="first last">pre-source EAPI defaults to 0, post-source EAPI is 2 (assuming the
173package manager didn't die when sourcing the ebuild thinking that EAPI 0
174is used).
175ebuild is masked because of the unsupported post-source EAPI.</p>
176</dd> 471</dd>
177</dl> 472</dl>
178</li> 473</li>
179</ul> 474</ul>
180</blockquote> 475</blockquote>
184problems too. The first is the requirement to have strict EAPI ordering, the 479problems too. The first is the requirement to have strict EAPI ordering, the
185second is ensuring that all the ebuilds for a single category/package-version 480second is ensuring that all the ebuilds for a single category/package-version
186are equivalent, i.e. installing any of them has exactly the same effect on a 481are equivalent, i.e. installing any of them has exactly the same effect on a
187given system.</p> 482given system.</p>
188</div> 483</div>
189<div class="section"> 484<div class="section" id="summary-of-ideas">
190<h1><a class="toc-backref" href="#id8" id="application" name="application">Application</a></h1> 485<h1><a class="toc-backref" href="#id12">Summary of ideas</a></h1>
191<p>Note that the developers should only set the pre-source EAPI. The process 486<div class="section" id="eapi-suffixed-ebuilds-proposed-solution">
192described above is only necessary to avoid undefined behaviour in corner cases 487<h2><a class="toc-backref" href="#id13">EAPI-suffixed ebuilds (proposed solution)</a></h2>
193and to retain backwards compatibility.</p>
194<p>QA tools may warn if the post-source EAPI is set at all, thus helping with the
195transition to the new format.</p>
196</div>
197<div class="section">
198<h1><a class="toc-backref" href="#id9" id="other-ideas" name="other-ideas">Other ideas</a></h1>
199<p>There were some other solutions proposed on the mailing list:</p>
200<blockquote>
201<ul>
202<li><dl class="first docutils"> 488<dl class="docutils">
203<dt>Set the EAPI inside the ebuild in a way that makes it easy to fetch it</dt> 489<dt>Properties:</dt>
204<dd><ul class="first last simple"> 490<dd><ul class="first last simple">
205<li>Doesn't meet the backward compatibility requirement.</li> 491<li>Can be used right away: yes</li>
206<li>Isn't forward compatible either.</li> 492<li>Hurts performance: no</li>
207<li>Could be confusing as ebuilds are considered bash scripts and this
208would impose additional restrictions on the ebuild format.</li>
209</ul>
210</dd>
211</dl> 493</ul>
494</dd>
212</li> 495</dl>
496<p>Some say it is clear and simple, others that it is ugly and unintuitive.</p>
497</div>
498<div class="section" id="eapi-in-the-filename-with-one-time-extension-change">
499<h2><a class="toc-backref" href="#id14">EAPI in the filename with one-time extension change</a></h2>
500<p>One of the proposed filename formats:
501<tt class="docutils literal"><span class="pre">&lt;PKG&gt;-&lt;VER&gt;.eapi-&lt;EAPI&gt;.eb</span></tt></p>
213<li><dl class="first docutils"> 502<dl class="docutils">
214<dt>Do the above and change the ebuild extension to <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt></dt> 503<dt>Properties:</dt>
215<dd><ul class="first last simple"> 504<dd><ul class="first last simple">
216<li>Meets the backward compatibility requirement.</li> 505<li>Can be used right away: yes</li>
217<li>Still can be confusing.</li> 506<li>Hurts performance: no</li>
218<li>Isn't really forward compatible. What would be after <tt class="docutils literal"><span class="pre">.ebuild-ng</span></tt>?
219<tt class="docutils literal"><span class="pre">.ebuild-ng-ng</span></tt>?</li>
220</ul>
221</dd>
222</dl> 507</ul>
508</dd>
223</li> 509</dl>
510<p>This is equivalent to the proposed solution.</p>
511<p>Some say it is better because the extension is static.</p>
512</div>
513<div class="section" id="easily-fetchable-eapi-inside-the-ebuild">
514<h2><a class="toc-backref" href="#id15">Easily fetchable EAPI inside the ebuild</a></h2>
224<li><dl class="first docutils"> 515<dl class="docutils">
225<dt>Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</dt> 516<dt>Properties:</dt>
226<dd><ul class="first last simple"> 517<dd><ul class="first last simple">
227<li>Meets both requirements.</li> 518<li>Can be used right away: no</li>
228<li>Introduces a noticeable performance hit (several more directory reads 519<li>Hurts performance: yes</li>
229in an I/O bound operation).</li> 520</ul>
521</dd>
522</dl>
523<p>Cannot be used right away as it would trigger the errors shown in Current
524behaviour section for old package managers.</p>
525<p>Performance decrease comes from the fact that with version format changes in the
526picture package managers need EAPI to parse the ebuild's version. That means that merely
527picking the best version of a package requires loading EAPI (from cache or the
528ebuild) for each available ebuild.</p>
529</div>
530<div class="section" id="easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change">
531<h2><a class="toc-backref" href="#id16">Easily fetchable EAPI inside the ebuild and one-time extension change</a></h2>
532<dl class="docutils">
533<dt>Properties:</dt>
534<dd><ul class="first last simple">
535<li>Can be used right away: yes</li>
536<li>Hurts performance: yes</li>
537</ul>
538</dd>
539</dl>
540<p>Performance decrease as described in the previous section.</p>
541<p>Some say it is clear and simple, others that it is confusing and unintuitive,
542because of the arbitrary format restrictions in what is a bash script otherwise.</p>
543</div>
544<div class="section" id="use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix">
545<h2><a class="toc-backref" href="#id17">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></h2>
546<dl class="docutils">
547<dt>Properties:</dt>
548<dd><ul class="first last simple">
549<li>Can be used right away: yes</li>
550<li>Hurts performance: yes</li>
551</ul>
552</dd>
553</dl>
554<p>Performance decrease comes from the fact that it adds several more directory
555reads.</p>
230<li>Makes it much harder for maintainers to see what they have.</li> 556<p>Some say that it makes it much harder for maintainers to see what they have.</p>
231</ul>
232</dd>
233</dl>
234</li>
235</ul>
236</blockquote>
237</div> 557</div>
238<div class="section"> 558</div>
559<div class="section" id="references">
239<h1><a class="toc-backref" href="#id10" id="references" name="references">References</a></h1> 560<h1><a class="toc-backref" href="#id18">References</a></h1>
240<table class="docutils footnote" frame="void" id="glep54" rules="none"> 561<table class="docutils footnote" frame="void" id="glep54" rules="none">
241<colgroup><col class="label" /><col /></colgroup> 562<colgroup><col class="label" /><col /></colgroup>
242<tbody valign="top"> 563<tbody valign="top">
243<tr><td class="label"><a class="fn-backref" href="#id1" name="glep54">[1]</a></td><td>GLEP 54, scm package version suffix 564<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>GLEP 54, scm package version suffix
244(<a class="reference" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr> 565(<a class="reference external" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr>
245</tbody> 566</tbody>
246</table> 567</table>
247<table class="docutils footnote" frame="void" id="portageproblems" rules="none"> 568<table class="docutils footnote" frame="void" id="portageproblems" rules="none">
248<colgroup><col class="label" /><col /></colgroup> 569<colgroup><col class="label" /><col /></colgroup>
249<tbody valign="top"> 570<tbody valign="top">
250<tr><td class="label"><a class="fn-backref" href="#id2" name="portageproblems">[2]</a></td><td>Common portage problems 571<tr><td class="label"><a class="fn-backref" href="#id2">[2]</a></td><td>Common portage problems
251(<a class="reference" href="http://www.gentoo.org/proj/en/portage/doc/common-problems.xml">http://www.gentoo.org/proj/en/portage/doc/common-problems.xml</a>)</td></tr> 572(<a class="reference external" href="http://www.gentoo.org/proj/en/portage/doc/common-problems.xml">http://www.gentoo.org/proj/en/portage/doc/common-problems.xml</a>)</td></tr>
252</tbody> 573</tbody>
253</table> 574</table>
254</div> 575</div>
255<div class="section"> 576<div class="section" id="copyright">
256<h1><a class="toc-backref" href="#id11" id="copyright" name="copyright">Copyright</a></h1> 577<h1><a class="toc-backref" href="#id19">Copyright</a></h1>
257<p>This document has been placed in the public domain.</p> 578<p>This document has been placed in the public domain.</p>
258<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : --> 579<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
259</div> 580</div>
260 581
261</div> 582</div>
262<div class="footer"> 583<div class="footer">
263<hr class="footer" /> 584<hr class="footer" />
264<a class="reference" href="glep-0055.txt">View document source</a>. 585<a class="reference external" href="glep-0055.txt">View document source</a>.
265Generated on: 2008-01-06 02:39 UTC. 586Generated on: 2009-05-17 15:29 UTC.
266Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. 587Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
267 588
268</div> 589</div>
269</body> 590</body>
270</html> 591</html>
271

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

  ViewVC Help
Powered by ViewVC 1.1.20