On Mon, Dec 8, 2014 at 12:08 PM, Matt Turner <matts...@gentoo.org> wrote:
> eclasses are pretty great for sharing code akin to a library, but when
> *all* of your ebuild's logic is in the eclass, well, that's not really
> the intended use case as far as I can tell.

It works well in cases like KDE where you have 300 ebuilds that all
just set a few environment variables and then genuinely share common
code for everything else.  Also, major updates only come once every
few years, which helps keep the eclass from becoming a rat's nest.  I
think it is better to just version an eclass instead of having a mess
of conditionals based on version, but then we'd have 300 revisions of
toolchain.eclass (which is probably a good hint that we're doing it
wrong).

A library is a good analogy of how to avoid all of this.  Each
function does one thing well, and you call them as you need them, and
you don't tweak their APIs 10 times per year.  And if you find you're
never using a function more than once after doing this, then you don't
need a library in the first place.

--
Rich

Reply via email to