/[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.3 Revision 1.6
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.5: http://docutils.sourceforge.net/" /> 7 <meta name="generator" content="Docutils 0.6: 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 <style type="text/css"> 9 <link rel="stylesheet" href="tools/glep.css" type="text/css" /></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>
253<body bgcolor="white"> 10<body bgcolor="white">
254<table class="navigation" cellpadding="0" cellspacing="0" 11<table class="navigation" cellpadding="0" cellspacing="0"
255 width="100%" border="0"> 12 width="100%" border="0">
256<tr><td class="navicon" width="150" height="35"> 13<tr><td class="navicon" width="150" height="35">
257<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page"> 14<a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
268<tbody valign="top"> 25<tbody valign="top">
269<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td> 26<tr class="field"><th class="field-name">GLEP:</th><td class="field-body">55</td>
270</tr> 27</tr>
271<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td> 28<tr class="field"><th class="field-name">Title:</th><td class="field-body">Use EAPI-suffixed ebuilds (.ebuild-EAPI)</td>
272</tr> 29</tr>
273<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.2</td> 30<tr class="field"><th class="field-name">Version:</th><td class="field-body">1.5</td>
274</tr> 31</tr>
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> 32<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">2009/05/17 20:56:53</a></td>
276</tr> 33</tr>
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> 34<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>
278</tr> 35</tr>
279<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td> 36<tr class="field"><th class="field-name">Status:</th><td class="field-body">Draft</td>
280</tr> 37</tr>
296<li><a class="reference internal" href="#problem" id="id4">Problem</a></li> 53<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> 54<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> 55<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> 56<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> 57<li><a class="reference internal" href="#new-version-format" id="id8">New version format</a></li>
301</ul> 58<li><a class="reference internal" href="#use-newer-bash-features" id="id9">Use newer bash features</a></li>
302</li> 59</ul>
60</li>
303<li><a class="reference internal" href="#abstract-solution" id="id9">Abstract solution</a></li> 61<li><a class="reference internal" href="#abstract-solution" id="id10">Abstract solution</a></li>
304<li><a class="reference internal" href="#proposed-solution" id="id10">Proposed solution</a></li> 62<li><a class="reference internal" href="#proposed-solution" id="id11">Proposed solution</a></li>
305<li><a class="reference internal" href="#specification" id="id11">Specification</a></li> 63<li><a class="reference internal" href="#specification" id="id12">Specification</a></li>
306<li><a class="reference internal" href="#summary-of-ideas" id="id12">Summary of ideas</a><ul> 64<li><a class="reference internal" href="#summary-of-ideas" id="id13">Summary of ideas</a><ul>
307<li><a class="reference internal" href="#eapi-suffixed-ebuilds-proposed-solution" id="id13">EAPI-suffixed ebuilds (proposed solution)</a></li> 65<li><a class="reference internal" href="#eapi-suffixed-ebuilds-proposed-solution" id="id14">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> 66<li><a class="reference internal" href="#eapi-in-the-filename-with-one-time-extension-change" id="id15">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> 67<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild" id="id16">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> 68<li><a class="reference internal" href="#easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change" id="id17">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> 69<li><a class="reference internal" href="#use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix" id="id18">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></li>
312</ul>
313</li> 70</ul>
71</li>
314<li><a class="reference internal" href="#references" id="id18">References</a></li> 72<li><a class="reference internal" href="#references" id="id19">References</a></li>
315<li><a class="reference internal" href="#copyright" id="id19">Copyright</a></li> 73<li><a class="reference internal" href="#copyright" id="id20">Copyright</a></li>
316</ul> 74</ul>
317</div> 75</div>
318<blockquote> 76<blockquote>
319<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian 77<p>&quot;A little learning is a dangerous thing; drink deep, or taste not the Pierian
320spring: there shallow draughts intoxicate the brain, and drinking largely 78spring: there shallow draughts intoxicate the brain, and drinking largely
339eclass functionality).</li> 97eclass functionality).</li>
340<li>Add new global scope functions in any sane way.</li> 98<li>Add new global scope functions in any sane way.</li>
341<li>Extend versioning rules in an EAPI - for example, addition of the scm 99<li>Extend versioning rules in an EAPI - for example, addition of the scm
342suffix - GLEP54 <a class="footnote-reference" href="#glep54" id="id1">[1]</a> or allowing more sensible version formats like 100suffix - 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> 101<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>
102<li>Use newer bash features.</li>
344</ul> 103</ul>
345</blockquote> 104</blockquote>
346</div> 105</div>
347<div class="section" id="current-behaviour"> 106<div class="section" id="current-behaviour">
348<h1><a class="toc-backref" href="#id5">Current behaviour</a></h1> 107<h1><a class="toc-backref" href="#id5">Current behaviour</a></h1>
380 139
381!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked. 140!!! 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: 141!!! One of the following masked packages is required to complete your request:
383- sys-apps/foo-1 (masked by: corruption) 142- sys-apps/foo-1 (masked by: corruption)
384</pre> 143</pre>
385<p>Current portage looks for eclasses only in the <tt class="docutils literal"><span class="pre">eclass</span></tt> directory of a 144<p>Current portage looks for eclasses only in the <tt class="docutils literal">eclass</tt> directory of a
386repository. This results in a fatal error and ebuild being masked by corruption 145repository. This results in a fatal error and ebuild being masked by corruption
387- might be pretty confusing to users.</p> 146- might be pretty confusing to users.</p>
388</div> 147</div>
389<div class="section" id="new-global-scope-function"> 148<div class="section" id="new-global-scope-function">
390<h2><a class="toc-backref" href="#id7">New global scope function</a></h2> 149<h2><a class="toc-backref" href="#id7">New global scope function</a></h2>
419 178
420emerge: there are no ebuilds to satisfy &quot;sys-apps/foo&quot; 179emerge: there are no ebuilds to satisfy &quot;sys-apps/foo&quot;
421</pre> 180</pre>
422<p>Not the best error message, especially if there are lots of them.</p> 181<p>Not the best error message, especially if there are lots of them.</p>
423</div> 182</div>
183<div class="section" id="use-newer-bash-features">
184<h2><a class="toc-backref" href="#id9">Use newer bash features</a></h2>
185<p><tt class="docutils literal">|&amp;</tt> is a new type of redirection added in bash-4. It cannot be used even in
186local scope as bash still parses the whole ebuild.</p>
187<p><tt class="docutils literal"><span class="pre">sys-apps/foo-1.ebuild</span></tt>:</p>
188<pre class="literal-block">
189EAPI=&quot;5&quot;
190
191foo() {
192 echo &quot;foo&quot; |&amp; cat
193}
194</pre>
195<p>Result:</p>
196<pre class="literal-block">
197/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: syntax error near unexpected token `&amp;'
198/var/lib/gentoo/repositories/peper/sys-apps/foo/foo-1.ebuild: line 8: ` echo &quot;foo&quot; |&amp; cat'
199*
200* ERROR: sys-apps/foo-1 failed.
201* Call stack:
202* ebuild.sh, line 1879: Called _source_ebuild
203* ebuild.sh, line 1818: Called die
204* The specific snippet of code:
205* source &quot;${EBUILD}&quot; || die &quot;error sourcing ebuild&quot;
206* The die message:
207* error sourcing ebuild
208*
209* If you need support, post the topmost build error, and the call stack if relevant.
210* This ebuild is from an overlay: '/var/lib/gentoo/repositories/peper/'
211* ... done!
212
213!!! All ebuilds that could satisfy &quot;sys-apps/foo&quot; have been masked.
214!!! One of the following masked packages is required to complete your request:
215- sys-apps/foo-1 (masked by: corruption)
216</pre>
217<p>Again, not the best error.</p>
218</div>
424</div> 219</div>
425<div class="section" id="abstract-solution"> 220<div class="section" id="abstract-solution">
426<h1><a class="toc-backref" href="#id9">Abstract solution</a></h1> 221<h1><a class="toc-backref" href="#id10">Abstract solution</a></h1>
427<p>A solution to this problem has to lift those limitations and the only way to do 222<p>A solution to this problem has to lift those limitations and the only way to do
428it is to make the EAPI of an ebuild available to the package managers in a way 223it is to make the EAPI of an ebuild available to the package managers in a way
429that doesn't require them to source the ebuild. Another important requirement is 224that doesn't require them to source the ebuild. Another important requirement is
430for the solution to be backward compatible, which has the pleasant side-effect 225for the solution to be backward compatible, which has the pleasant side-effect
431of making the solution applicable in the Gentoo tree right away. Opposed to 226of making the solution applicable in the Gentoo tree right away. Opposed to
432waiting an arbitrary amount of time, which is never long enough anyway, as the 227waiting an arbitrary amount of time, which is never long enough anyway, as the
433issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2">[2]</a> - show.</p> 228issues listed on the common portage problems page - <a class="footnote-reference" href="#portageproblems" id="id2">[2]</a> - show.</p>
434</div> 229</div>
435<div class="section" id="proposed-solution"> 230<div class="section" id="proposed-solution">
436<h1><a class="toc-backref" href="#id10">Proposed solution</a></h1> 231<h1><a class="toc-backref" href="#id11">Proposed solution</a></h1>
437<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This 232<p>The proposed solution is to use EAPI-suffixed file extensions for ebuilds. This
438allows package managers to trivially read the EAPI from the ebuild filename. It 233allows package managers to trivially read the EAPI from the ebuild filename. It
439is also backwards compatible, because currently ebuilds are recognised by the 234is also backwards compatible, because currently ebuilds are recognised by the
440<tt class="docutils literal"><span class="pre">.ebuild</span></tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by 235<tt class="docutils literal">.ebuild</tt> file extension and hence EAPI-suffixed ebuilds are simply ignored by
441the package managers.</p> 236the package managers.</p>
442</div> 237</div>
443<div class="section" id="specification"> 238<div class="section" id="specification">
444<h1><a class="toc-backref" href="#id11">Specification</a></h1> 239<h1><a class="toc-backref" href="#id12">Specification</a></h1>
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 240<p>Ebuild filename extension syntax: <tt class="docutils literal"><span class="pre">ebuild[-&lt;EAPI&gt;]</span></tt>, where <tt class="docutils literal">[]</tt> denotes an
446optional part, and <tt class="docutils literal"><span class="pre">&lt;EAPI&gt;</span></tt> is the EAPI of the ebuild.</p> 241optional part, and <tt class="docutils literal">&lt;EAPI&gt;</tt> is the EAPI of the ebuild.</p>
447<p>The EAPI used by the ebuild is the EAPI included in the filename if it is set. 242<p>The EAPI used by the ebuild is the EAPI included in the filename if it is set.
448Otherwise the EAPI set inside the ebuild is used, which defaults to 0 (this is 243Otherwise the EAPI set inside the ebuild is used, which defaults to 0 (this is
449the current behaviour).</p> 244the current behaviour).</p>
450<p>Ebuilds with unsupported EAPIs are masked.</p> 245<p>Ebuilds with unsupported EAPIs are masked.</p>
451<p>It should be considered an error to set the EAPI both in the filename and in the 246<p>It should be considered an error to set the EAPI both in the filename and in the
478allowing authors to provide backwards compatible ebuilds, it would introduce 273allowing authors to provide backwards compatible ebuilds, it would introduce
479problems too. The first is the requirement to have strict EAPI ordering, the 274problems too. The first is the requirement to have strict EAPI ordering, the
480second is ensuring that all the ebuilds for a single category/package-version 275second is ensuring that all the ebuilds for a single category/package-version
481are equivalent, i.e. installing any of them has exactly the same effect on a 276are equivalent, i.e. installing any of them has exactly the same effect on a
482given system.</p> 277given system.</p>
278<p>Also note that it is not a new restriction. It is already possible to illegally
279have multiple versions with different EAPIs as e.g. <tt class="docutils literal">1.0 == 1.00 == <span class="pre">1.00-r0</span></tt>
280and hence you could have <tt class="docutils literal"><span class="pre">foo-1.0.ebuild</span></tt> with EAPI X and <tt class="docutils literal"><span class="pre">foo-1.00.ebuild</span></tt>
281with EAPI Y.</p>
483</div> 282</div>
484<div class="section" id="summary-of-ideas"> 283<div class="section" id="summary-of-ideas">
485<h1><a class="toc-backref" href="#id12">Summary of ideas</a></h1> 284<h1><a class="toc-backref" href="#id13">Summary of ideas</a></h1>
486<div class="section" id="eapi-suffixed-ebuilds-proposed-solution"> 285<div class="section" id="eapi-suffixed-ebuilds-proposed-solution">
487<h2><a class="toc-backref" href="#id13">EAPI-suffixed ebuilds (proposed solution)</a></h2> 286<h2><a class="toc-backref" href="#id14">EAPI-suffixed ebuilds (proposed solution)</a></h2>
488<dl class="docutils"> 287<dl class="docutils">
489<dt>Properties:</dt> 288<dt>Properties:</dt>
490<dd><ul class="first last simple"> 289<dd><ul class="first last simple">
491<li>Can be used right away: yes</li> 290<li>Can be used right away: yes</li>
492<li>Hurts performance: no</li> 291<li>Hurts performance: no</li>
494</dd> 293</dd>
495</dl> 294</dl>
496<p>Some say it is clear and simple, others that it is ugly and unintuitive.</p> 295<p>Some say it is clear and simple, others that it is ugly and unintuitive.</p>
497</div> 296</div>
498<div class="section" id="eapi-in-the-filename-with-one-time-extension-change"> 297<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> 298<h2><a class="toc-backref" href="#id15">EAPI in the filename with one-time extension change</a></h2>
500<p>One of the proposed filename formats: 299<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> 300<tt class="docutils literal"><span class="pre">&lt;PKG&gt;-&lt;VER&gt;.eapi-&lt;EAPI&gt;.eb</span></tt></p>
502<dl class="docutils"> 301<dl class="docutils">
503<dt>Properties:</dt> 302<dt>Properties:</dt>
504<dd><ul class="first last simple"> 303<dd><ul class="first last simple">
509</dl> 308</dl>
510<p>This is equivalent to the proposed solution.</p> 309<p>This is equivalent to the proposed solution.</p>
511<p>Some say it is better because the extension is static.</p> 310<p>Some say it is better because the extension is static.</p>
512</div> 311</div>
513<div class="section" id="easily-fetchable-eapi-inside-the-ebuild"> 312<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> 313<h2><a class="toc-backref" href="#id16">Easily fetchable EAPI inside the ebuild</a></h2>
515<dl class="docutils"> 314<dl class="docutils">
516<dt>Properties:</dt> 315<dt>Properties:</dt>
517<dd><ul class="first last simple"> 316<dd><ul class="first last simple">
518<li>Can be used right away: no</li> 317<li>Can be used right away: no</li>
519<li>Hurts performance: yes</li> 318<li>Hurts performance: yes</li>
524behaviour section for old package managers.</p> 323behaviour section for old package managers.</p>
525<p>Performance decrease comes from the fact that with version format changes in the 324<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 325picture 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 326picking the best version of a package requires loading EAPI (from cache or the
528ebuild) for each available ebuild.</p> 327ebuild) for each available ebuild.</p>
328<p>Here is more or less how the package manager figures out the best available
329version for a package with N versions available.</p>
330<blockquote>
331<ul class="simple">
332<li>EAPI in the filename<ul>
333<li>Read the directory containing the package - readdir()</li>
334<li>For each ebuild, read its EAPI and using that parse its version - no I/O</li>
335<li>Sort the versions - no I/O</li>
336<li>Going down from the highest to the lowest version<ul>
337<li>Get the metadata from cache - 2 x stat() + read()</li>
338<li>break if the version is visible</li>
339</ul>
340</li>
341</ul>
342</li>
343<li>EAPI in the ebuild<ul>
344<li>Read the directory containing the package - readdir()</li>
345<li>For each ebuild load its metadata from cache to get its EAPI - N x (2 x stat() + read())</li>
346<li>Sort the versions - no I/O</li>
347<li>Going down from the highest to the lowest version<ul>
348<li>(metadata is already loaded) - no I/O</li>
349<li>break if the version is visible - no I/O</li>
350</ul>
351</li>
352</ul>
353</li>
354</ul>
355</blockquote>
356<p>The difference is in for how many versions the package manager needs to hit
357cache. With EAPI in the ebuild it needs to do that for all versions, with EAPI
358in the filename it depends on versions visibility.
359For example, package foo has versions 1, 2, 3, 4, 5 and 6. 6 is masked, 5 is
360~arch and 1,2,3 and 4 are arch. Say, the user accepts only arch for this
361package. With EAPI in the filename it will read metadata only for versions
3626, 5 and 4. With EAPI in the ebuild it needs to load metadata for all versions.</p>
363<p>It's hard to say what's the avarage case, but surely the worst case scenario
364(when only the lowest version is visible) is uncommon.</p>
529</div> 365</div>
530<div class="section" id="easily-fetchable-eapi-inside-the-ebuild-and-one-time-extension-change"> 366<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> 367<h2><a class="toc-backref" href="#id17">Easily fetchable EAPI inside the ebuild and one-time extension change</a></h2>
532<dl class="docutils"> 368<dl class="docutils">
533<dt>Properties:</dt> 369<dt>Properties:</dt>
534<dd><ul class="first last simple"> 370<dd><ul class="first last simple">
535<li>Can be used right away: yes</li> 371<li>Can be used right away: yes</li>
536<li>Hurts performance: yes</li> 372<li>Hurts performance: yes</li>
540<p>Performance decrease as described in the previous section.</p> 376<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, 377<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> 378because of the arbitrary format restrictions in what is a bash script otherwise.</p>
543</div> 379</div>
544<div class="section" id="use-different-subdirectories-for-different-eapis-i-e-cat-pkg-eapix"> 380<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> 381<h2><a class="toc-backref" href="#id18">Use different subdirectories for different EAPIs, i.e. cat/pkg/eapiX/</a></h2>
546<dl class="docutils"> 382<dl class="docutils">
547<dt>Properties:</dt> 383<dt>Properties:</dt>
548<dd><ul class="first last simple"> 384<dd><ul class="first last simple">
549<li>Can be used right away: yes</li> 385<li>Can be used right away: yes</li>
550<li>Hurts performance: yes</li> 386<li>Hurts performance: yes</li>
555reads.</p> 391reads.</p>
556<p>Some say that it makes it much harder for maintainers to see what they have.</p> 392<p>Some say that it makes it much harder for maintainers to see what they have.</p>
557</div> 393</div>
558</div> 394</div>
559<div class="section" id="references"> 395<div class="section" id="references">
560<h1><a class="toc-backref" href="#id18">References</a></h1> 396<h1><a class="toc-backref" href="#id19">References</a></h1>
561<table class="docutils footnote" frame="void" id="glep54" rules="none"> 397<table class="docutils footnote" frame="void" id="glep54" rules="none">
562<colgroup><col class="label" /><col /></colgroup> 398<colgroup><col class="label" /><col /></colgroup>
563<tbody valign="top"> 399<tbody valign="top">
564<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>GLEP 54, scm package version suffix 400<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>GLEP 54, scm package version suffix
565(<a class="reference external" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</a>)</td></tr> 401(<a class="reference external" href="http://glep.gentoo.org/glep-0054.html">http://glep.gentoo.org/glep-0054.html</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> 408(<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>
573</tbody> 409</tbody>
574</table> 410</table>
575</div> 411</div>
576<div class="section" id="copyright"> 412<div class="section" id="copyright">
577<h1><a class="toc-backref" href="#id19">Copyright</a></h1> 413<h1><a class="toc-backref" href="#id20">Copyright</a></h1>
578<p>This document has been placed in the public domain.</p> 414<p>This document has been placed in the public domain.</p>
579<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : --> 415<!-- vim: set tw=80 fileencoding=utf-8 spell spelllang=en et : -->
580</div> 416</div>
581 417
582</div> 418</div>
583<div class="footer"> 419<div class="footer">
584<hr class="footer" /> 420<hr class="footer" />
585<a class="reference external" href="glep-0055.txt">View document source</a>. 421<a class="reference external" href="glep-0055.txt">View document source</a>.
586Generated on: 2009-05-17 15:29 UTC. 422Generated on: 2010-04-07 22:12 UTC.
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. 423Generated 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.
588 424
589</div> 425</div>
590</body> 426</body>
591</html> 427</html>

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

  ViewVC Help
Powered by ViewVC 1.1.20