1 |
On 05/26/2016 18:28, rindeal wrote: |
2 |
> I've noticed that ebuilds for at least dev-lang/perl and |
3 |
> sys-libs/glibc are using some concept of "eblits", which seems like |
4 |
> parts of ebuilds scattered across $FILESDIR with ebuilds containing |
5 |
> some logic (involving eval) which includes and runs them. |
6 |
> |
7 |
> I haven't found any documentation related to them so I'm asking here: |
8 |
> |
9 |
> 1) what are they? |
10 |
> 2) why are they used? |
11 |
|
12 |
I'm the other user of eblits in sys-kernel/mips-sources. There's a lot of |
13 |
common code in that package that doesn't need to be duplicated between multiple |
14 |
ebuilds, so years ago, I converted to using versioned eblits. It's a touch |
15 |
manual, in that I have to manually check that all consumers of a specific eblit |
16 |
version are removed from the tree before I remove the deprecated version, but |
17 |
it avoids the nasty problem of changing an eblit for a newer ebuild that breaks |
18 |
an older ebuild. |
19 |
|
20 |
I started on an "eblits.eclass" a few months ago, but sidetracked and didn't |
21 |
get back to it. Attached, if anyone wants to play with it. It includes the |
22 |
core eblit loading functions used in mips-sources, which might be more |
23 |
updated/robust than the ones in glibc (last I checked the logic, but vapier can |
24 |
clarify if true or not). The last comment block is incomplete. I sidetracked |
25 |
in finishing item #2 when pondering how to define a global "check" variable in |
26 |
the eclass itself to control when the eblit core functions were loaded and all |
27 |
eblits parsed (see latest mips-sources ebuild, $MIPS_SOURCES_EBLITS_LOADED). |
28 |
|
29 |
Also handles the case of when installing from binary packages and $FILESDIR |
30 |
isn't available. The eblit source for the pkg_* phases are packed onto the end |
31 |
of the bzip2 tarball so they're available to Portage & friends. |
32 |
|
33 |
The core eblit loading functions are the only duplicated code in the |
34 |
mips-sources ebuilds, as well as glibc and other eblit users (perl?). I don't |
35 |
remember what the argument for or against eblits might have been back in the |
36 |
day, but for ebuilds whose only real changes are datestamps and/or version |
37 |
numbers, eblits are a nice way to encapsulate and share common code that is too |
38 |
specific for a global eclass. Centralizing the eblit code will allow |
39 |
mips-sources and glibc ebuilds to shrink their overall filesize a little-bit |
40 |
more (~1.5KB per mips-sources ebuild, so 3.4KB per ebuild instead of the |
41 |
current 4.9KB). |
42 |
|
43 |
And yes, for anyone wondering, I have new mips-sources ebuilds. Just took a |
44 |
month to partially rewrite the SGI Origin/IP27 kernel code and then hunt down a |
45 |
hardware bug on my SGI Octane, so, been distracted... |
46 |
|
47 |
-- |
48 |
Joshua Kinard |
49 |
Gentoo/MIPS |
50 |
kumba@g.o |
51 |
6144R/F5C6C943 2015-04-27 |
52 |
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943 |
53 |
|
54 |
"The past tempts us, the present confuses us, the future frightens us. And our |
55 |
lives slip away, moment by moment, lost in that vast, terrible in-between." |
56 |
|
57 |
--Emperor Turhan, Centauri Republic |