Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172831 - inherit unclearness
Summary: inherit unclearness
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 22:04 UTC by Vlastimil Babka (Caster) (RETIRED)
Modified: 2012-04-05 13:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-03-30 22:04:23 UTC
I think Chapter 7 is unclear wrt inherit in few ways:

- it doesn't say that you can call inherit at most once (?) per ebuild/eclass and with one or more eclasses
- I think it should specify the order of loading (in the order after inherit, eclasses inherited by first specified eclass are recursively loaded before second eclass etc)
- related to this, "INHERITED metadata variable contains the name of every eclass used" - what's "used", isn't it "loaded so far?"
- what happens if eclass is attempted to be loaded more than once 
- maybe make clear that EXPORT_FUNCTIONed phase may be overriden by later eclass wrt the load order, then ebuild
Comment 1 SpanKY gentoo-dev 2007-03-30 22:52:31 UTC
- i dont think there's anything wrong with calling "inherit" more than once ... in fact, it's useful in some cases to keep code clean ... the phrasing should be that it's highly recommended that all inherited eclasses be specified at the top of the ebuild/eclass and that all relevant eclasses be inherited in one line

the rest seems common sense (but should be OK to codify):
 - nothing wrong with inheriting more than once
 - variables that arent accumulated are always set to the last value while variables that are accumulated get done logically so
 - functions get inherited/overridden in logical order
Comment 2 Ciaran McCreesh 2007-03-30 23:28:47 UTC
Yeah, inherit multiple times is useful if you need to do conditionals on, say, ${PN}.
Comment 3 Ciaran McCreesh 2007-04-11 20:01:14 UTC
r140 should be a bit better.