Gentoo Archives: gentoo-pms

From: "Michał Górny" <mgorny@g.o>
To: gentoo-pms@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-pms] [PATCH 24/28] EAPI 7 allows die in subshell.
Date: Wed, 04 Oct 2017 20:48:03
Message-Id: 20171004204712.10391-25-mgorny@gentoo.org
In Reply to: [gentoo-pms] [PATCHES] EAPI 7, first draft for review by "Michał Górny"
1 Bug: https://bugs.gentoo.org/465008
2 ---
3 eapi-differences.tex | 4 ++++
4 pkg-mgr-commands.tex | 23 +++++++++++++++--------
5 2 files changed, 19 insertions(+), 8 deletions(-)
6
7 diff --git a/eapi-differences.tex b/eapi-differences.tex
8 index fb469f6..a0d1f01 100644
9 --- a/eapi-differences.tex
10 +++ b/eapi-differences.tex
11 @@ -41,6 +41,9 @@ of this document for a complete table of previous EAPIs.
12 \bottomrule
13 \endlastfoot
14
15 +\t{die} in subshell & \compactfeatureref{subshell-die} &
16 + No & No & No & No & Yes \\
17 +
18 \t{nonfatal} function+command & \compactfeatureref{nonfatal-fallback} &
19 No & No & No & No & Yes \\
20
21 @@ -459,6 +462,7 @@ EAPI 7 is EAPI 6 with the following changes:
22 \item \t{dolib} and \t{libopts} banned, \featureref{banned-commands}.
23 \item \t{nonfatal} defined both as a shell function and external command,
24 \featureref{nonfatal-fallback}.
25 +\item \t{die} guaranteed to work in a subshell environment, \featureref{subshell-die}.
26 \end{compactitem}
27
28 \ChangeWhenAddingAnEAPI{7}
29 diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
30 index c17c9cc..af4cd35 100644
31 --- a/pkg-mgr-commands.tex
32 +++ b/pkg-mgr-commands.tex
33 @@ -181,23 +181,30 @@ completing. Ebuilds must not run any of these commands once the current phase fu
34 \item[die] \featurelabel{nonfatal-die} If called under the \t{nonfatal} command (as per
35 section~\ref{sec:failure-behaviour}) and with \t{-n} as its first parameter, displays a failure
36 message provided in its following argument and then returns a non-zero exit status. Only in
37 - EAPIs listed in table~\ref{tab:nonfatal-die} as supporting option~\t{-n}. Otherwise, displays
38 + EAPIs listed in table~\ref{tab:die-properties} as supporting option~\t{-n}. Otherwise, displays
39 a failure message provided in its first and only argument, and then aborts the build process.
40 - \t{die} is \e{not} guaranteed to work correctly if called from a subshell environment.
41 +
42 + \featurelabel{subshell-die} In EAPIs listed in table~\ref{tab:die-properties} as not providing
43 + subshell support, \t{die} is \e{not} guaranteed to work correctly if called from a subshell
44 + environment.
45 \item[assert] Checks the value of the shell's pipe status variable, and if any component is non-zero
46 (indicating failure), calls \t{die}, passing any parameters to it.
47 \end{description}
48
49 \ChangeWhenAddingAnEAPI{7}
50 -\begin{centertable}{EAPIs supporting \t{-n} for \t{die} and \t{assert} commands}
51 - \label{tab:nonfatal-die}
52 - \begin{tabular}{ll}
53 +\begin{centertable}{EAPI-specific properties of \t{die} and \t{assert} commands}
54 + \label{tab:die-properties}
55 + \begin{tabular}{lll}
56 \toprule
57 \multicolumn{1}{c}{\textbf{EAPI}} &
58 - \multicolumn{1}{c}{\textbf{\t{die} and \t{assert} support \t{-n}?}} \\
59 + \multicolumn{2}{c}{\textbf{\t{die} and \t{assert}}} \\
60 + &
61 + \multicolumn{1}{c}{\textbf{support \t{-n}?}} &
62 + \multicolumn{1}{c}{\textbf{work in subshell?}} \\
63 \midrule
64 - 0, 1, 2, 3, 4, 5 & No \\
65 - 6, 7 & Yes \\
66 + 0, 1, 2, 3, 4, 5 & No & No \\
67 + 6 & Yes & No \\
68 + 7 & Yes & Yes \\
69 \bottomrule
70 \end{tabular}
71 \end{centertable}
72 --
73 2.14.2