From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3236D138293 for ; Sun, 29 May 2016 01:11:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8511914218; Sun, 29 May 2016 01:11:42 +0000 (UTC) Received: from resqmta-ch2-12v.sys.comcast.net (resqmta-ch2-12v.sys.comcast.net [69.252.207.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B2FC71412D for ; Sun, 29 May 2016 01:11:41 +0000 (UTC) Received: from resomta-ch2-12v.sys.comcast.net ([69.252.207.108]) by comcast with SMTP id 6pGIbKClAgEHv6pGXbpwIK; Sun, 29 May 2016 01:11:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1464484301; bh=W+mVBXIFw7FPOIh5eHMkQKBf4euI6qeba3Rb+kh+U5A=; h=Received:Received:Subject:To:From:Message-ID:Date:MIME-Version: Content-Type; b=d8TNf/zOOzPqQVqpGUdma2Xl5iynlAv7ET4mFQlD2LjQ59TS6bHFaNQRBIr9rPwji eCJyjlQ4YZTmn+h8DTGlpP8RPBKv25M2V/SlpNcu+uhHQrYciWYDKiHGd3mOJHYkFG tATYxSiP4QetmpzhIrz/bEPpFHbvE7f3o5WaubyjOZ8sTFciKRl8rBxPpttwZhSzVK myke5geOxzhQOHKH1Dsdw7huHyhQIQaWqLdkbXCtmQzTrcw+5dWQuFnbsreSrxnU0U lzrYy28prI39TaJnB8Wzw61NqBd2lSvh+HfLv42DJYoELUlv64V2fkZTokZsB+TtV9 s5ccurbdufT6Q== Received: from [192.168.1.13] ([76.106.83.43]) by resomta-ch2-12v.sys.comcast.net with comcast id 01Bg1t0090w5D38011BgHp; Sun, 29 May 2016 01:11:41 +0000 Subject: Re: [gentoo-dev] What are eblits? To: gentoo-dev@lists.gentoo.org References: From: Joshua Kinard Message-ID: <66d4acaa-4c75-540f-eb65-4f7b40e40b02@gentoo.org> Date: Sat, 28 May 2016 21:11:15 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: f00febef-5531-4801-a63e-dcf9637d495a X-Archives-Hash: d7166e66c3470a43083abffa01188d8d On 05/26/2016 21:28, Kent Fredric wrote: > On 27 May 2016 at 10:28, rindeal 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 kumba@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