On Tue, Mar 13, 2012 at 07:05:57PM -0700, Zac Medico wrote: > On 03/13/2012 06:42 PM, Brian Harring wrote: > > Leaving it such that the PM has to enforce things like "don't have > > multiple EAPI assignments" means by default, one of them isn't going > > to... leading to the ebuilds breaking... specifically the common case > > being the ebuild becoming acclimated to some quirk of portage. > > My intention is for PMS to specify the search algorithm that's used to > probe the EAPI, and also for it to specify that package managers must > treat an ebuild as invalid if the probed EAPI is not identical to the > one that's obtained from bash.
*Now* is when you should be applying your KISS wikipedia links (moreso, the principle applied to your proposal). What you're talking about is requiring PMs to monitor what occured and bail- rather than precluding it from even occuring. I repeat; try to spot the situation and make things blow up, rather than disallowing it from occuring in the first place. It's really that simple; this is why the "grep the assignment" out of the source is at its core, a well intentioned but fundamentally bad idea. It's glue on a bad situation rather than just removing the bad situation. > If all package managers adhere strictly > to these two requirements, then we won't have any incompatibilities > between package managers here. You're missing a lot of the point here; defining some search algo is basically screwed at its core due to the flexibility of bash. Simple example: if [ "$PV" -eq 9999 ]; then EAPI=3 else EAPI=2 fi The flexibility of bash means that your attempt to enforce simplistic rules like "it must be greppable" are at loggerheads; if the rules were "last is the one thats used", then I just invert the if check. Yep, the above is stupid code. Frankly, the sort of stupid code I'd expect out of a newbie ebuild dev. The EAPI bit there is synthetic, but that sort of construct (putting everything into a single file, then using symlinks to expose differing versions) is out in the wild and used. The fact that potential exists is a flat out sign the approach is broken. Worse, it's a way to trip up people- specifically new devs who don't know fun rules like "the PM has this lovely search algo for getting EAPI that you must abide by". ~brian