Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 486146 - src_install docs still call || die everywhere
Summary: src_install docs still call || die everywhere
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL: http://devmanual.gentoo.org/ebuild-wr...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-09-27 01:19 UTC by Michael Orlitzky
Modified: 2014-05-05 10:22 UTC (History)
0 users

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


Attachments
A patch favoring EAPI >= 4 (0001-Update-the-src_install-reference-to-favor-EAPI-4.patch,5.85 KB, patch)
2014-05-03 13:25 UTC, Michael Orlitzky
Details | Diff
Fix EAPI ordering language (0001-src_install-Fix-two-instances-where-the-language-pre.patch,1.13 KB, patch)
2014-05-05 02:52 UTC, Michael Orlitzky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2013-09-27 01:19:06 UTC
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.
Comment 1 Markos Chandras (RETIRED) gentoo-dev 2013-09-28 09:36:11 UTC
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.
Comment 2 Michael Orlitzky gentoo-dev 2013-09-28 13:08:34 UTC
(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.
Comment 3 Michael Orlitzky gentoo-dev 2014-05-03 04:32:11 UTC
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
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2014-05-03 12:36:30 UTC
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.
Comment 5 Michael Orlitzky gentoo-dev 2014-05-03 12:49:39 UTC
Ah, the "default src_install" section is fine. Check out "Trivial Installs".
Comment 6 Michael Orlitzky gentoo-dev 2014-05-03 13:25:35 UTC
Created attachment 376282 [details, diff]
A patch favoring EAPI >= 4
Comment 7 Markos Chandras (RETIRED) gentoo-dev 2014-05-03 17:49:16 UTC
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?
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2014-05-04 10:52:16 UTC
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
Comment 9 Ulrich Müller gentoo-dev 2014-05-04 11:28:56 UTC
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
Comment 10 Markos Chandras (RETIRED) gentoo-dev 2014-05-04 11:33:02 UTC
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 &#8805; 4</important>
+<important>The following examples assume EAPI 4 or later</important>
 </body>
 </section>
Comment 11 Ulrich Müller gentoo-dev 2014-05-04 12:03:54 UTC
(In reply to Markos Chandras from comment #10)
> Is that better?

Yes.
Comment 12 Markos Chandras (RETIRED) gentoo-dev 2014-05-04 12:07:23 UTC
(In reply to Ulrich Müller from comment #11)
> (In reply to Markos Chandras from comment #10)
> > Is that better?
> 
> Yes.

Thanks pushed.
Comment 13 Michael Orlitzky gentoo-dev 2014-05-04 17:07:58 UTC
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 &lt; 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 &#8805; 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() {
Comment 14 Markos Chandras (RETIRED) gentoo-dev 2014-05-04 21:12:24 UTC
(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 &lt; 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 &#8805; 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)
Comment 15 Michael Orlitzky gentoo-dev 2014-05-05 02:52:36 UTC
Created attachment 376388 [details, diff]
Fix EAPI ordering language

Sure thing.
Comment 16 Markos Chandras (RETIRED) gentoo-dev 2014-05-05 10:22:01 UTC
Thanks pushed