On 05/26/2016 21:28, Kent Fredric wrote:
> On 27 May 2016 at 10:28, rindeal <dev.rind...@gmail.com> wrote:
>>
>> 1) what are they?
>> 2) why are they used?
> 
> 
> My best explanation is its a way to re-use very large amounts of code
> between 2 ebuilds, without resorting to:
> 
> a) Copying the whole ebuild and hoping you find the relevant part in diffs
> b) Not needing reams of version-specific conditional code to make
> copying ebuilds between versions easier.
> c) Not needing confusing eclasses that exist to serve a single
> package, loaded with lots of weird conditional logic.
> 
> My understanding is you could effectively roll the eblits back into
> the ebuild statically, just doing so would make keeping the changes
> consistent harder.
> 
> Its clearly designed for a system where you have ~10 different
> versions of Perl available or ~10 different versions of glibc
> available, but you don't want to pay the price of duplicating that
> logic wholesale for every minor concurrent revision, and only want to
> update essential differences when you need to, not because you have
> to.
> 
> That said, its a very confusing system to get your head around,
> because its *basically* yet another "mixin" system like "inherit", but
> done in bash, which itself is a rather strange language to be doing
> something as complicated as mixins.

An accurate explanation, but probably better to say they're more like "local
eclasses".  If you think of the existing eclasses in ${PORTDIR}/eclass as
"global", that is, they contain common code utilized by multiple unrelated
ebuild packages, then eblits were originally envisioned as localized versions
of eclasses to share package-specific code between multiple ebuilds of
differing versions.

Whether the idea is useful in the present day and age, eh, who knows.  For the
mips-sources ebuilds, eblits let me centralize the per-machine notes and
unpacking logic, which reduced each ebuild's size from ~18KB a few years ago
down to ~4.9KB today.

-- 
Joshua Kinard
Gentoo/MIPS
ku...@gentoo.org
6144R/F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

Reply via email to