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

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

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

Revision 1.1 Revision 1.2
1GLEP: 33 1GLEP: 33
2Title: Eclass Restructure/Redesign 2Title: Eclass Restructure/Redesign
3Version: $Revision: 1.1 $ 3Version: $Revision: 1.2 $
4Last-Modified: $Date: 2005/02/16 21:30:44 $ 4Last-Modified: $Date: 2005/03/06 20:33:20 $
5Author: John Mylchreest <johnm@gentoo.org>, Brian Harring <ferringb@gentoo.org> 5Author: Brian Harring <ferringb@gentoo.org>, John Mylchreest <johnm@gentoo.org>
6Status: Draft 6Status: Draft
7Type: Standards Track 7Type: Standards Track
8Content-Type: text/x-rst 8Content-Type: text/x-rst
9Created: 29-Jan-2005 9Created: 29-Jan-2005
10Post-History: 29-Jan-2005 10Post-History: 29-Jan-2005
15 15
16For any design, the transition from theoretical to applied exposes inadequacies 16For any design, the transition from theoretical to applied exposes inadequacies
17in the original design. This document is intended to document, and propose a 17in the original design. This document is intended to document, and propose a
18revision of the current eclass setup to address current eclass inadequacies. 18revision of the current eclass setup to address current eclass inadequacies.
19 19
20This document proposes several thing- the creation of ebuild libraries, 'elibs', 20This document proposes several things- the creation of ebuild libraries, 'elibs',
21a narrowing of the focus of eclasses, a move of eclasses w/in the tree, the 21a narrowing of the focus of eclasses, a move of eclasses w/in the tree, the
22addition of changelogs, and a way to allow for simple eclass gpg signing. 22addition of changelogs, and a way to allow for simple eclass gpg signing.
23In general, a large scale restructuring of what eclasses are and how they're 23In general, a large scale restructuring of what eclasses are and how they're
24implemented. Essentially version two of the eclass setup. 24implemented. Essentially version two of the eclass setup.
25 25
27Terminology 27Terminology
28=========== 28===========
29 29
30From this point on, the proposed eclass setup will be called 'new eclasses', the 30From this point on, the proposed eclass setup will be called 'new eclasses', the
31existing crop (as of this writing) will be referenced as 'old eclasses'. The 31existing crop (as of this writing) will be referenced as 'old eclasses'. The
32destinction is elaborated on within this document. 32distinction is elaborated on within this document.
33 33
34 34
35Motivation and Rationale 35Motivation and Rationale
36======================== 36========================
37 37
38Eclasses within the tree currently are a bit of a mess- they're forced to 38Eclasses within the tree currently are a bit of a mess- they're forced to
39maintain backwards compatability w/ all previous functionality. In effect, 39maintain backwards compatibility w/ all previous functionality. In effect,
40their api is constant, and can only be added to- never changing the existing 40their api is constant, and can only be added to- never changing the existing
41functionality. This obviously is quite limiting, and leads to cruft accrueing in 41functionality. This obviously is quite limiting, and leads to cruft accruing in
42eclasses as a eclasses design is refined. This needs to be dealt with prior to 42eclasses as a eclasses design is refined. This needs to be dealt with prior to
43eclass code reaching a critical mass where they become unmanagable/fragile 43eclass code reaching a critical mass where they become unmanageable/fragile
44(recent pushes for eclass versioning could be interpretted as proof of this). 44(recent pushes for eclass versioning could be interpreted as proof of this).
45 45
46Beyond that, eclasses were originally intended as a method to allow for ebuilds 46Beyond that, eclasses were originally intended as a method to allow for ebuilds
47to use a pre-existing block of code, rather then having to duplicate the code in 47to use a pre-existing block of code, rather then having to duplicate the code in
48each ebuild. This is a good thing, but there are ill effects that result from 48each ebuild. This is a good thing, but there are ill effects that result from
49the current design. Eclasses inherit other eclasses to get a single function- in 49the current design. Eclasses inherit other eclasses to get a single function- in
65the sand. Old eclasses allowed for this, behaved this way. New eclasses allow 65the sand. Old eclasses allowed for this, behaved this way. New eclasses allow
66for that, and behave this way. This should reduce misconceptions about what is 66for that, and behave this way. This should reduce misconceptions about what is
67allowed/possible with eclasses, thus reducing bugs that result from said 67allowed/possible with eclasses, thus reducing bugs that result from said
68misconceptions. 68misconceptions.
69 69
70A few words on elibs- think of them as a clear definition between behavioral
71functionality of an eclass, and the library functionality. Eclass's modify
72template data, and are the basis for other ebuilds- elibs, however are *just*
73common bash functionality.
74
75Consider the majority of the portage bin/* scripts- these all are candidates for
76being added to the tree as elibs, as is the bulk of eutils.
77
70 78
71Specification. 79Specification.
72============== 80==============
73 81
74The various parts of this proposal are broken down into a set of changes and 82The various parts of this proposal are broken down into a set of changes and
91A new directory named elib should be added to the top level of the tree to serve 99A new directory named elib should be added to the top level of the tree to serve
92as a repository of ebuild function libraries. Rather then relying on using the 100as a repository of ebuild function libraries. Rather then relying on using the
93source command, an 'elib' function should be added to portage to import that 101source command, an 'elib' function should be added to portage to import that
94libraries functionality. The reason for the indirection via the function is 102libraries functionality. The reason for the indirection via the function is
95mostly related to portage internals, but it does serve as an abstraction such 103mostly related to portage internals, but it does serve as an abstraction such
96that (for example) zsh compatability hacks could be hidden in the elib function. 104that (for example) zsh compatibility hacks could be hidden in the elib function.
97 105
98Elib's will be collections of bash functions- they're not allowed to do anything 106Elib's will be collections of bash functions- they're not allowed to do anything
99in the global scope aside from function definition, and any -minimal- 107in the global scope aside from function definition, and any -minimal-
100initialization of the library that is absolutely needed. Additionally, they 108initialization of the library that is absolutely needed. Additionally, they
101cannot modify any ebuild functions- src_compile, src_unpack fex. Since they are 109cannot modify any ebuild template functions- src_compile, src_unpack. Since they are
102required to not modify the metadata keys, nor in any way affect the ebuild aside 110required to not modify the metadata keys, nor in any way affect the ebuild aside
103from providing functionality, they can be conditionally pulled in. They also 111from providing functionality, they can be conditionally pulled in. They also
104are allowed to pull in other elibs, but strictly just elibs- no eclasses, just 112are allowed to pull in other elibs, but strictly just elibs- no eclasses, just
105other elibs. A realworld example would be the eutils eclass. 113other elibs. A real world example would be the eutils eclass.
106 114
107Portage, since the elib's don't modify metadata, isn't required to track elibs 115Portage, since the elib's don't modify metadata, isn't required to track elibs
108as it tracks eclasses. Thus a change in an elib doesn't result in half the tree 116as it tracks eclasses. Thus a change in an elib doesn't result in half the tree
109forced to be regenerated/marked stale when changed (this is more of an infra 117forced to be regenerated/marked stale when changed (this is more of an infra
110benefit, although regen's that take too long due to eclass changes have been 118benefit, although regen's that take too long due to eclass changes have been
111known to cause rsync issues due to missing timestamps). The only thing portage 119known to cause rsync issues due to missing timestamps).
112will do for elibs, aside from provide the elib function, is track what elibs 120
113have been loaded thus far, and load an elib only if it hasn't been loaded once 121Elibs will not be available in the global scope of an eclass, or ebuild- nor during the
114already. An implication of this (if it wasn't clear from the elib description) 122depends phase (basically a phase that sources the ebuild, to get it's metadata). Elib
123calls in the global scope will be tracked, but the elib will not be loaded till just before
124the setup phase (pkg_setup). There are two reasons for this- first, it ensures elibs are
125completely incapable of modifying metadata. There is no room for confusion, late loading
126of elibs gives you the functionality for all phases, except for depends- depends being the
127only phase that is capable of specifying metadata. Second, as an added bonus, late
128loading reduces the amount of bash sourced for a regen- faster regens. This however is minor,
129and is an ancillary benefit of the first reason.
130
131There are a few further restrictions with elibs- mainly, elibs to load can only be specified
132in either global scope, or in the setup, unpack, compile, test, and install phases. You can
133not load elibs in prerm, postrm, preinst, and postinst. The reason being, for *rm phases,
134installed pkgs will have to look to the tree for the elib, which allows for api drift to cause
135breakage. For *inst phases, same thing, except the culprit is binpkgs.
136
115is that elibs cannot change their exported api dependant on the api (as some 137There is a final restriction- elibs cannot change their exported api dependent on the api
116eclass do for example). 138(as some eclass do for example). The reason mainly being that elibs are loaded once- not
139multiple times, as eclasses are.
140
141To clarify, for example this is invalid.
142::
143 if [[ -n ${SOME_VAR} ]]; then
144 func x() { echo "I'm accessible only via tweaking some var";}
145 else
146 func x() { echo "this is invalid, do not do it."; }
147 fi
148
117 149
118Regarding maintainability of elibs, it should be a less of a load then old 150Regarding maintainability of elibs, it should be a less of a load then old
119eclasses. One of the major issues with old eclasses is that their functions are 151eclasses. One of the major issues with old eclasses is that their functions are
120quite incestuous- they're bound tightly to the env they're defined in. This 152quite incestuous- they're bound tightly to the env they're defined in. This
121makes eclass functions a bit fragile- the restrictions on what can, and cannot 153makes eclass functions a bit fragile- the restrictions on what can, and cannot
122be done in elibs will address this, making functionality less fragile (thus a 154be done in elibs will address this, making functionality less fragile (thus a
123bit more maintainable). 155bit more maintainable).
124 156
125There is no need for backwards compatability with elibs- they just must work 157There is no need for backwards compatibility with elibs- they just must work
126against the current tree. Thus elibs can be removed when the tree no longer 158against the current tree. Thus elibs can be removed when the tree no longer
127needs them. The reasons for this are explained below. 159needs them. The reasons for this are explained below.
128 160
129Structuring of the elibs directory will be exactly the same as that of the new 161Structuring of the elibs directory will be exactly the same as that of the new
130eclass directory (detailed below), sans a different extension. 162eclass directory (detailed below), sans a different extension.
131 163
164As to why their are so many restrictions, the answer is simple- the definition of
165what elibs are, what they are capable of, and how to use them is nailed down as much as
166possible to avoid *any* ambiguity related to them. The intention is to make it clear,
167such that no misconceptions occur, resulting in bugs.
132 168
133The reduced role of Eclasses, and a clarification of existing Eclass requirements 169The reduced role of Eclasses, and a clarification of existing Eclass requirements
134--------------------------------------------------------------------------------- 170---------------------------------------------------------------------------------
135 171
136Since elibs are now intended on holding common bash functionality, the focus of 172Since elibs are now intended on holding common bash functionality, the focus of
151metadata keys exported from an ebuild on system A, must be *exactly* the same as 187metadata keys exported from an ebuild on system A, must be *exactly* the same as
152the keys exported on system B. 188the keys exported on system B.
153 189
154If an eclass (or ebuild for that matter) violates this constant requirement, it 190If an eclass (or ebuild for that matter) violates this constant requirement, it
155leads to portage doing the wrong thing for rsync users- for example, wrong deps 191leads to portage doing the wrong thing for rsync users- for example, wrong deps
156pulled in, leading to compilation failure. 192pulled in, leading to compilation failure, or dud deps.
157 193
158If the existing metadata isn't flexible enough for what is required for a 194If the existing metadata isn't flexible enough for what is required for a
159package, the parsing of the metadata is changed to address that. Cases where 195package, the parsing of the metadata is changed to address that. Cases where
160the constant requirement is violated are known, and a select few are allowed- 196the constant requirement is violated are known, and a select few are allowed-
161these are exceptions to the rule that are required due to inadequacies in 197these are exceptions to the rule that are required due to inadequacies in
162portage. In other words, those *few* exceptions are allowed because it's the 198portage. Any case where it's determined the constant requirement may need to be
163only way to do it at this time. Any case where it's determined the constant 199violated the dev must make it aware to the majority of devs, along with the portage
164requirement may need to be violated the dev must make it aware to the majority 200devs. This should be done prior to committing.
165of devs, and the portage devs- violation of the constant rule has far reaching
166effects.
167 201
168It's quite likely there is a way to allow what you're attempting- if you just go 202It's quite likely there is a way to allow what you're attempting- if you just go
169and do it, the rsync users (our userbase) suffer the results of compilation 203and do it, the rsync users (our user base) suffer the results of compilation
170failures and unneeded deps being pulled in. 204failures and unneeded deps being pulled in.
171 205
172After that stern reminder, back to new eclasses. Defining INHERITED and ECLASS 206After that stern reminder, back to new eclasses. Defining INHERITED and ECLASS
173within the eclass is no longer required. Portage already handles those vars if 207within the eclass is no longer required. Portage already handles those vars if
174they aren't defined. 208they aren't defined.
175 209
176As with elibs, it's no longer required backwards compatability be maintained 210As with elibs, it's no longer required that backwards compatibility be maintained
177indefinitely- compatability must be maintained against the current tree, but 211indefinitely- compatibility must be maintained against the current tree, but
178just that. As such new eclasses (the true distinction of new vs old is 212just that. As such new eclasses (the true distinction of new vs old is
179elaborated in the next section) can be removed from the tree once they're no 213elaborated in the next section) can be removed from the tree once they're no
180longer in use. 214longer in use.
181 215
182 216
183The end of backwards compatability... 217The end of backwards compatibility...
184------------------------------------- 218-------------------------------------
185 219
186With current eclasses, once the eclass is in use, it's api can no longer be 220With current eclasses, once the eclass is in use, it's api can no longer be
187changed, nor can the eclass ever be removed from the tree. This is why we still 221changed, nor can the eclass ever be removed from the tree. This is why we still
188have *ancient* eclasses that are completely unused sitting in the tree, for 222have *ancient* eclasses that are completely unused sitting in the tree, for
192 226
193For a real world example of this, if you merged a glibc 2 years back, whatever 227For a real world example of this, if you merged a glibc 2 years back, whatever
194eclasses it used must still be compatible, or you may not be able to unmerge the 228eclasses it used must still be compatible, or you may not be able to unmerge the
195older glibc version during an upgrade to a newer version. So either the glibc 229older glibc version during an upgrade to a newer version. So either the glibc
196maintainer is left with the option of leaving people using ancient versions out 230maintainer is left with the option of leaving people using ancient versions out
197in the rain, or maintaining an ever increasing load of backwards compatability 231in the rain, or maintaining an ever increasing load of backwards compatibility
198cruft in any used eclasses. 232cruft in any used eclasses.
199 233
200Binpkgs suffer a similar fate. Merging of a binpkg pulls needed eclasses from 234Binpkgs suffer a similar fate. Merging of a binpkg pulls needed eclasses from
201the tree, so you may not be able to even merge a binpkg if the eclasses api has 235the tree, so you may not be able to even merge a binpkg if the eclasses api has
202changed. If the eclass was removed, you can't even merge the binpkg, period. 236changed. If the eclass was removed, you can't even merge the binpkg, period.
205ebuild was built in already contains the eclasses functions, as such the env can 239ebuild was built in already contains the eclasses functions, as such the env can
206be re-used rather then relying on the eclass. In other words, binpkgs and 240be re-used rather then relying on the eclass. In other words, binpkgs and
207installed ebuilds will no longer go and pull needed eclasses from the tree, 241installed ebuilds will no longer go and pull needed eclasses from the tree,
208they'll use the 'saved' version of the eclass they were built/merged with. 242they'll use the 'saved' version of the eclass they were built/merged with.
209 243
210So the backwards compatability requirement for users of the next major portage 244So the backwards compatibility requirement for users of the next major portage
211version (and beyond) isn't required. All the cruft can be dropped. 245version (and beyond) isn't required. All the cruft can be dropped.
212 246
213The problem is that there will be users using older versions of portage that 247The problem is that there will be users using older versions of portage that don't
214don't support this functionality. So backwards compatability must be maintained 248support this functionality- these older installations *cannot* use the
215for them. Additionally, earlier versions of portage haven't always handled the 249new eclasses, due to the fact that their portage version is incapable of
216env correctly- for broken saved envs, the eclasses backwards compatability is 250properly relying on the env- in other words, the varying api of the eclass will
217still required. Waiting N months preserving backwards compatability in current 251result in user-visible failures during unmerging.
218eclasses, then dropping the support isn't much of an option. There always are
219stragglers who don't upgrade, beyond that, there is the possibility of cases
220where users -will- upgrade, but still be bitten (broken saved envs from earlier
221portage installations). More importantly, it doesn't provide a route to
222upgrade/fix things if a user lags behind, exempting trying to find a compatabile
223version of the eclass in viewcvs (assuming it hasn't been sent to the attic
224already). Obviously, that isn't acceptable.
225 252
226With the next major portage release, it will be possible to drop backwards 253So we're able to do a clean break of all old eclasses, and api cruft, but we need
227compatability for eclasses, and all lingering cruft. What is needed is a way to 254a means to basically disallow access to the new eclasses for all portage versions
228take full advantage of this functionality, without completely screwing over the 255incapable of properly handling the env requirements.
229unfortunates and those who don't upgrade.
230 256
231Unfortunately, the creation of new eclasses within the tree has an additional 257Unfortunately, we cannot just rely on a different grouping/naming convention within
232snag due to portage. The existing inherit function that is used to pull in old 258the old eclass directory. The new eclasses must be inaccessible, and portage throws
259a snag into this- the existing inherit function that is used to handle existing
233eclasses- basically, whatever it's passed (inherit kernel or inherit 260eclasses. Basically, whatever it's passed (inherit kernel or inherit
234kernel/kernel) it will pull in (kernel.eclass, and kernel/kernel.eclass 261kernel/kernel) it will pull in (kernel.eclass, and kernel/kernel.eclass
235respectively). So even if the new eclasses were implemented within a 262respectively). So even if the new eclasses were implemented within a
236subdirectory of the eclass dir in the tree, all current portage versions would 263subdirectory of the eclass dir in the tree, all current portage versions would
237still be able to access them. 264still be able to access them.
238 265
243Tree restructuring. 270Tree restructuring.
244------------------- 271-------------------
245 272
246There are only two way to block the existing (as of this writing) inherit 273There are only two way to block the existing (as of this writing) inherit
247functionality from accessing the new eclasses- either change the extension of 274functionality from accessing the new eclasses- either change the extension of
248eclasses to something other then 'eclass', or to have them stored in a seperate 275eclasses to something other then 'eclass', or to have them stored in a separate
249subdirectory of the tree then eclass. 276subdirectory of the tree then eclass.
250 277
251The latter is preferable, and the proposed solution. Reasons are- the current 278The latter is preferable, and the proposed solution. Reasons are- the current
252eclass directory is already overgrown. Structuring of the new eclass dir 279eclass directory is already overgrown. Structuring of the new eclass dir
253(clarified below) will allow for easier signing, ChangeLogs, and grouping of 280(clarified below) will allow for easier signing, ChangeLogs, and grouping of
257 284
258If it's unclear as to why the old inherit function *cannot* access the new 285If it's unclear as to why the old inherit function *cannot* access the new
259eclasses, please reread the previous section. It's unfortunately a requirement 286eclasses, please reread the previous section. It's unfortunately a requirement
260to take advantage of all that the next major portage release will allow. 287to take advantage of all that the next major portage release will allow.
261 288
262The proposed directory sructure is ${PORTDIR}/include/{eclass,elib}. 289The proposed directory structure is ${PORTDIR}/include/{eclass,elib}.
263Something like ${PORTDIR}/new-eclass, or ${PORTDIR}/eclass-ng could be used 290Something like ${PORTDIR}/new-eclass, or ${PORTDIR}/eclass-ng could be used
264(although many would cringe at the -ng), but such a name is unwise. Consider the 291(although many would cringe at the -ng), but such a name is unwise. Consider the
265possibility (likely a fact) that new eclasses someday may be found lacking, and 292possibility (likely a fact) that new eclasses someday may be found lacking, and
266refined further (version three as it were). Or perhaps we want to add yet more 293refined further (version three as it were). Or perhaps we want to add yet more
267functionality with direct relation to sourcing new files, and we would then need 294functionality with direct relation to sourcing new files, and we would then need
280 307
281No eclasses will be allowed in the base directory- grouping of new eclasses will 308No eclasses will be allowed in the base directory- grouping of new eclasses will
282be required to help keep things tidy, and for the following reasons. Grouping 309be required to help keep things tidy, and for the following reasons. Grouping
283of eclasses allows for the addition of ChangeLogs that are specific to that 310of eclasses allows for the addition of ChangeLogs that are specific to that
284group of eclasses, grouping of files/patches as needed, and allows for 311group of eclasses, grouping of files/patches as needed, and allows for
285saner/easier signing of eclasses- basically, you can just stick a signed 312saner/easier signing of eclasses- you can just stick a signed
286Manifest file w/in that grouping, thus providing the information portage needs 313Manifest file w/in that grouping, thus providing the information portage needs
287to ensure no files are missing, and that nothing has been tainted. 314to ensure no files are missing, and that nothing has been tainted.
288 315
289The elib directory will be structured in the same way, for the same reasons. 316The elib directory will be structured in the same way, for the same reasons.
290 317
291Repoman will have to be extended to work within new eclass and elib groups, and 318Repoman will have to be extended to work within new eclass and elib groups, and
292to handle signing and commiting. This is intentional, and a good thing. This 319to handle signing and committing. This is intentional, and a good thing. This
293gives repoman the possibility of doing sanity checks on elibs/new eclasses. 320gives repoman the possibility of doing sanity checks on elibs/new eclasses.
294It won't solve developers doing dumb things with eclasses (no technological
295solution would, exempting a tazering), but it will give us a way to automate
296checks to try and prevent honest mistakes from slipping through and breaking
297things for our users.
298 321
322Note these checks will not prevent developers from doing dumb things with eclass-
323these checks would only be capable of doing basic sanity checks, such as syntax checks.
324There is no way to prevent people from doing dumb things (exempting perhaps repeated
325applications of a cattle prod)- these are strictly automatic checks, akin to repoman's
326dependency checks.
299 327
328
300The start of a different phase of backwards compatability 329The start of a different phase of backwards compatibility
301--------------------------------------------------------- 330---------------------------------------------------------
302 331
303As clarified above, new eclasses will exist in a seperate directory that will be 332As clarified above, new eclasses will exist in a separate directory that will be
304intentionally inaccessible to the inherit function. As such, users of older 333intentionally inaccessible to the inherit function. As such, users of older
305portage versions *will* have to upgrade to merge any ebuild that uses elibs/new 334portage versions *will* have to upgrade to merge any ebuild that uses elibs/new
306eclasses. A depend on the next major portage version would address 335eclasses. A depend on the next major portage version would transparently handle
307transparently handle this for rsync users. 336this for rsync users.
308 337
309There still is the issue of users who haven't upgraded to the required portage 338There still is the issue of users who haven't upgraded to the required portage
310version. This is a minor concern frankly- portage releases include new 339version. This is a minor concern frankly- portage releases include new
311functionality, and bug fixes. If they won't upgrade, it's assumed they have 340functionality, and bug fixes. If they won't upgrade, it's assumed they have
312their reasons and are big boys, thus able to handle the complications themselves. 341their reasons and are big boys, thus able to handle the complications themselves.
329 358
330For users who do not upgrade within the window of N months while the old 359For users who do not upgrade within the window of N months while the old
331eclasses are in the tree, as stated, it's assumed they know what they are doing. 360eclasses are in the tree, as stated, it's assumed they know what they are doing.
332If they specifically block the new portage version, as the ebuilds in the tree 361If they specifically block the new portage version, as the ebuilds in the tree
333migrate to the new eclasses, they will have less and less ebuilds available to 362migrate to the new eclasses, they will have less and less ebuilds available to
334them. If they tried injecting the new portage version (lieing to portage, 363them. If they tried injecting the new portage version (lying to portage,
335essentially), portage would bail since it cannot find the new eclass. Note that 364essentially), portage would bail since it cannot find the new eclass.
336for them to even get to this point, they'd have to somehow disable the DEPEND on 365For ebuilds that use the new eclasses, there really isn't any way to sidestep
337a new version of portage- either hack up the ebuild, or do an injection. 366the portage version requirement- same as it has been for other portage features.
338Essentially they'd have to actively try to sidestep sanity checks implemented to
339make the shift over from old to new transparent. If they've
340disabled/sidestepped our attempt at a transparent migration, they can deal with
341the repercussions of it.
342 367
343What is a bit more annoying is that once the old eclasses are out of the tree, 368What is a bit more annoying is that once the old eclasses are out of the tree,
369if a user has not upgraded to a portage version supporting env processing, they
344users will lose the ability to unmerge any installed ebuild that used an old 370will lose the ability to unmerge any installed ebuild that used an old
345eclass, further users will lose the ability to merge any tbz2 that uses old 371eclass. Same cause, different symptom being they will lose the ability to merge
346eclasses. 372any tbz2 that uses old eclasses also.
347 373
348They however will *not* be left out in the rain. For merging old eclass 374There is one additional case that is a rarity, but should be noted- if a user
349binpkgs, and unmerging installed packages, they can merge the old eclass compat 375has suffered significant corruption of their installed package database (vdb). This is
350ebuild. The compat ebuild provides the missing eclasses, thus providing that 376ignoring the question of whether the vdb is even usable at this point, but the possibility
351lost functionality. 377exists for the saved envs to be non usable due to either A) missing, or B) corrupted.
378In such a case, even with the new portage capabilities, they would need
379the old eclass compat ebuild.
352 380
381Note for this to happen requires either rather... unwise uses of root, or significant
382fs corruption. Regardless of the cause, it's quite likely for this to even become an
383issue, the system's vdb is completely unusable. It's a moot issue at that point.
384If you lose your vdb, or it gets seriously damaged, it's akin to lobotomizing portage-
385it doesn't know what's installed, it doesn't know of it's own files, and in general,
386a rebuilding of the system is about the only sane course of action. The missing env is
387truly the least of the users concern in such a case.
388
389Continuing with the more likely scenario, users unwilling to upgrade portage will
390*not* be left out in the rain. Merging the old eclass compat ebuild will provide
391the missing eclasses, thus providing that lost functionality .
392
353The intention isn't to force them to upgrade, hence the ability to restore the 393Note the intention isn't to force them to upgrade, hence the ability to restore the
354lost functionality. The intention is to clean up the existing mess, and allow us 394lost functionality. The intention is to clean up the existing mess, and allow us
355to move forward. The saying "you've got to break a few eggs to make an omelete" 395to move forward. The saying "you've got to break a few eggs to make an omelet"
356is akin, exempting the fact we're providing a way to make the eggs whole again 396is akin, exempting the fact we're providing a way to make the eggs whole again
357(the king's men would've loved such an option). 397(the king's men would've loved such an option).
358
359It's advisable that once all old eclasses are no longer in use in the tree, the
360old eclass package is added to system default. Remember that even those who
361have upgraded to a portage version that handles the env correctly, may run into
362instances where an installed packages env is corrupt. For new bootstraps (which
363automatically upgrade portage right off the bat), an injection of the compat
364package would be advisable- unless they downgrade portage, they will never need
365the old eclasses.
366 398
367 399
368Migrating to the new setup 400Migrating to the new setup
369-------------------------- 401--------------------------
370 402
401 433
402 434
403Backwards Compatibility 435Backwards Compatibility
404======================= 436=======================
405 437
406All backwards compatability issues are addressed inline, but a recap is offered- 438All backwards compatibility issues are addressed in line, but a recap is offered-
407it's suggested that if the a particular compatability issue is 439it's suggested that if the a particular compatibility issue is
408questioned/worried over, the reader read the relevant section. There should be 440questioned/worried over, the reader read the relevant section. There should be
409a more in depth discussion of the issue, along with a more extensive explanation 441a more in depth discussion of the issue, along with a more extensive explanation
410of the potential solutions, and reasons for the choosen solution. 442of the potential solutions, and reasons for the chosen solution.
411 443
412To recap: 444To recap:
413:: 445::
414
415 New eclasses and elib functionality will be tied to a specific portage 446 New eclasses and elib functionality will be tied to a specific portage
416 version. A DEPENDs on said portage version should address this for rsync 447 version. A DEPENDs on said portage version should address this for rsync
417 users who refuse to upgrade to a portage version that supports the new 448 users who refuse to upgrade to a portage version that supports the new
418 eclasses/elibs and will gradually be unable to merge ebuilds that use said 449 eclasses/elibs and will gradually be unable to merge ebuilds that use said
419 functionality. It is their choice to upgrade, as such, the gradual 450 functionality. It is their choice to upgrade, as such, the gradual
420 'thinning' of available ebuilds should they block the portage upgrade is 451 'thinning' of available ebuilds should they block the portage upgrade is
421 their responsibility. 452 their responsibility.
422 453
423 Old eclasses at some point in the future should be removed from the tree, 454 Old eclasses at some point in the future should be removed from the tree,
424 and released in a tarball/ebuild. This will cause installed ebuilds that 455 and released in a tarball/ebuild. This will cause installed ebuilds that
425 rely on the old eclass to be unable to unmerge to behave as expected, with 456 rely on the old eclass to be unable to unmerge, with the same applying for
426 the same applying for merging of binpkgs. 457 merging of binpkgs dependent on the following paragraph.
427 458
428 This eclass ebuild should be a system depends target to make the transition 459 The old eclass-compat is only required for users who do not upgrade their
429 transparent. Future portage ebuilds, and the old eclass compat ebuild should 460 portage installation, and one further exemption- if the user has somehow
430 not inherit any eclasses. The reason for this is that in doing so, it may 461 corrupted/destroyed their installed pkgs database (/var/db/pkg currently),
431 block upgrade paths. At least for portage, this already is something of a 462 in the process, they've lost their saved environments. The eclass-compat
432 known issue for ebuild functionality- due to what it is/provides, it must 463 ebuild would be required for ebuilds that required older eclasses in such a
433 essentially be standalone, and cannot benefit from any eclass/elib 464 case. Note, this case is rare also- as clarified above, it's mentioned
434 functionality. 465 strictly to be complete, it's not much of a real world scenario as elaborated
466 above.
435 467
436 468
437Copyright 469Copyright
438========= 470=========
439 471

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

  ViewVC Help
Powered by ViewVC 1.1.20