[gentoo-commits] proj/devmanual:master commit in: ebuild-writing/error-handling/
commit: 56fe3529e0ae3d83bf5dc7e506345cbecf19ca0b Author: Sam James gentoo org> AuthorDate: Sat Mar 20 09:26:05 2021 + Commit: Ulrich Müller gentoo org> CommitDate: Mon Mar 29 20:41:36 2021 + URL:https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=56fe3529 ebuild-writing/error-handling: use eapply, not epatch Signed-off-by: Sam James gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> ebuild-writing/error-handling/text.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebuild-writing/error-handling/text.xml b/ebuild-writing/error-handling/text.xml index 110f317..2e99f17 100644 --- a/ebuild-writing/error-handling/text.xml +++ b/ebuild-writing/error-handling/text.xml @@ -96,7 +96,7 @@ When using pipes, a subshell is introduced, so the following is unsafe: -cat list | while read file ; do epatch ${file} ; done +cat list | while read file ; do eapply ${file} ; done @@ -105,7 +105,7 @@ avoids this problem: -while read file ; do epatch ${file} ; done list +while read file ; do eapply ${file} ; done list
[gentoo-commits] proj/devmanual:master commit in: ebuild-writing/error-handling/
commit: 2fa7e69aa732f1053f6429d3a1fa4789a12b0c8b Author: Sam James gentoo org> AuthorDate: Fri Mar 12 21:17:18 2021 + Commit: Ulrich Müller gentoo org> CommitDate: Sun Mar 21 05:47:41 2021 + URL:https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=2fa7e69a ebuild-writing/error-handling: add note for external commands and die Signed-off-by: Sam James gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> ebuild-writing/error-handling/text.xml | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ebuild-writing/error-handling/text.xml b/ebuild-writing/error-handling/text.xml index f74f6d8..3c5289c 100644 --- a/ebuild-writing/error-handling/text.xml +++ b/ebuild-writing/error-handling/text.xml @@ -57,9 +57,10 @@ Sometimes displaying additional error information beforehand can be useful. Use eerror to do this. See . - -It's best to use || die too often than too little. - + +You should use die on almost all external commands in ebuilds. + +
[gentoo-commits] proj/devmanual:master commit in: ebuild-writing/error-handling/
commit: f1e70d2f313e385d5284b83f93566f5ea16973d0 Author: Mikle Kolyada gentoo org> AuthorDate: Thu Jul 19 21:50:15 2018 + Commit: Göktürk Yüksek gentoo org> CommitDate: Mon Dec 2 21:32:12 2019 + URL:https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=f1e70d2f ebuild-writing/error-handling: expand subshell warning to EAPI=7 Closes: https://github.com/gentoo/devmanual/pull/90 Signed-off-by: Göktürk Yüksek gentoo.org> ebuild-writing/error-handling/text.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebuild-writing/error-handling/text.xml b/ebuild-writing/error-handling/text.xml index 96dc962..35c7419 100644 --- a/ebuild-writing/error-handling/text.xml +++ b/ebuild-writing/error-handling/text.xml @@ -69,7 +69,7 @@ It's best to use || die too often than too little. -die will not work in a subshell. +die will not work in a subshell unless you are using EAPI=7 and onwards.
[gentoo-commits] proj/devmanual:master commit in: ebuild-writing/error-handling/
commit: e2d15f91cfb5fc3d7773ee70dc8675b78e6500ca Author: Göktürk Yüksek gentoo org> AuthorDate: Thu Apr 27 23:07:35 2017 + Commit: Göktürk Yüksek gentoo org> CommitDate: Sat May 6 22:46:40 2017 + URL:https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e2d15f91 ebuild-writing/error-handling: improve ebuild and eclass failure behavior Instead of explaining the EAPI<=4 die behavior initially, explain the default behavior for the later EAPIs first. Remove the portage-specific bits from the paragraph. Reported-By: Benda Xu gentoo.org> ebuild-writing/error-handling/text.xml | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ebuild-writing/error-handling/text.xml b/ebuild-writing/error-handling/text.xml index 40b8b5b..da9e88d 100644 --- a/ebuild-writing/error-handling/text.xml +++ b/ebuild-writing/error-handling/text.xml @@ -47,11 +47,10 @@ function can die in multiple places. -Some portage-provided functions will automatically die upon failure. Others will -not. It is for example safe to omit the || die after a call to epatch, -but not emake. The reason is that external binaries are not able to call -die that is a bash function. You can see what commands are external binaries -with ls /usr/lib*/portage/bin/ebuild-helpers. In EAPI>=4 all ebuild-helpers automatically die upon failure. +Ebuild helpers from EAPI 4 and onwards automatically die on +failure. Some eclass-provided functions will automatically die upon +failure, others will not. Developers should check the +eclass reference when in doubt.