It's probably time to change this given the prevalence of EAPI >= 4 and the council suggestion to use the latest EAPI. A note can be added for previous EAPIs.
I believe that wherever || die is used, then there is also a suitable EAPI= line in the ebuild. It's useful to have these because we have plenty of old ebuilds in the tree. New developers might get confused and they start thinking that || die is obsolete even in older EAPIs. This is clearly wrong. src_install || die is not the only leftover from old EAPIs but I see no reason to start removing these. We don't add more example ebuilds in old EAPIs, but the existing ones can be changes during time if necessary.
(In reply to Markos Chandras from comment #1) > I believe that wherever || die is used, then there is also a suitable EAPI= > line in the ebuild. It's useful to have these because we have plenty of old > ebuilds in the tree. New developers might get confused and they start > thinking that || die is obsolete even in older EAPIs. This is clearly wrong. > src_install || die is not the only leftover from old EAPIs but I see no > reason to start removing these. > > We don't add more example ebuilds in old EAPIs, but the existing ones can be > changes during time if necessary. Can you take another look at this please (the page in the URL field)? There's an entire page of src_install examples and the EAPI is not mentioned anywhere.
Re-ping with evidence =) <mjo> fearedbliss: unrelated ebuild comments <mjo> You don't need || die after the do* helpers <mjo> and you do need them after "cp -r..." <fearedbliss> mjo: I saw the || die after do statements in the src_install link
Just as I explained on #comment 1, emake DESTDIR="${D}" install || die "Install failed" is perfectly valid for EAPI<4, so there is nothing wrong on that page. If you feel this needs to be updated for EAPI>=4, then we need a patch for that page, to make it clear that all examples are for EAPI>=4 so || die must not be used for e* and do* functions. The "Default src_install" as presented on that page, makes it clear what's the deal with EAPI>=4 and EAPI<4 so as far as I am concerned, the page is good enough.
Ah, the "default src_install" section is fine. Check out "Trivial Installs".
Created attachment 376282 [details, diff] A patch favoring EAPI >= 4
There is a lot of duplication in your patch. In my opinion, we should not be teaching developers about EAPI <5 so I think it's best if you drop all the EAPI >= 4 conditionals and use something like: EAPI=5 ... src_install() { emake DESTDIR="${D}" install dodoc README CHANGES } and EAPI=5 ... emake DESTDIR="${D}" install EAPI=5 ... src_install() { dobin udevinfo dobin udevtest into / dosbin udev dosbin udevd dosbin udevsend dosbin udevstart If someone is trying to use src_install (and any other ebuild functions) without reading about EAPIs first, well, we can't do much about that can we?
I committed the following: http://git.overlays.gentoo.org/gitweb/?p=proj/devmanual.git;a=commit;h=ae270a6ad3300cdf9872ab671df3e13601b32b82 Let me know what you think. If it does not look good, please reopen this bug
Please don't use expressions like "EAPI >= 4", but say "EAPIs 4 or 5" or "EAPI 4 or later". EAPI names are strings and don't have any numerical sort order: http://dev.gentoo.org/~ulm/pms/5/pms.html#x1-270003.1.7
Sorry about that Is that better? --- a/ebuild-writing/functions/src_install/text.xml +++ b/ebuild-writing/functions/src_install/text.xml @@ -62,7 +62,7 @@ src_install() { fi } </codesample> -<important>The following examples assume EAPI ≥ 4</important> +<important>The following examples assume EAPI 4 or later</important> </body> </section>
(In reply to Markos Chandras from comment #10) > Is that better? Yes.
(In reply to Ulrich Müller from comment #11) > (In reply to Markos Chandras from comment #10) > > Is that better? > > Yes. Thanks pushed.
Looks good, thank you. Here's another quick fix per ulm's suggestion: --- a/ebuild-writing/functions/src_install/text.xml +++ b/ebuild-writing/functions/src_install/text.xml @@ -32,7 +32,8 @@ <title>Default <c>src_install</c></title> <body> <p> -For EAPI < 4, the default <c>src_install</c> function is the following: +For EAPIs 0,1,2, and 3, the default <c>src_install</c> function is the +following: </p> <codesample lang="ebuild"> src_install() @@ -41,7 +42,7 @@ src_install() } </codesample> <p> -For EAPI ≥ 4, the default <c>src_install</c> function is the following: +For EAPIs 4 and later, the default <c>src_install</c> function is the following: </p> <codesample lang="ebuild"> src_install() {
(In reply to Michael Orlitzky from comment #13) > Looks good, thank you. Here's another quick fix per ulm's suggestion: > > --- a/ebuild-writing/functions/src_install/text.xml > +++ b/ebuild-writing/functions/src_install/text.xml > @@ -32,7 +32,8 @@ > <title>Default <c>src_install</c></title> > <body> > <p> > -For EAPI < 4, the default <c>src_install</c> function is the following: > +For EAPIs 0,1,2, and 3, the default <c>src_install</c> function is the > +following: > </p> > <codesample lang="ebuild"> > src_install() > @@ -41,7 +42,7 @@ src_install() > } > </codesample> > <p> > -For EAPI ≥ 4, the default <c>src_install</c> function is the > following: > +For EAPIs 4 and later, the default <c>src_install</c> function is the > following: > </p> > <codesample lang="ebuild"> > src_install() { Please submit a proper git-format patch so you can get proper credit (and make my life easier)
Created attachment 376388 [details, diff] Fix EAPI ordering language Sure thing.
Thanks pushed