1 |
commit: 6f705e02045cd53c461f5dadd6a70c7565c03602 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 16 14:42:19 2015 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Aug 30 18:57:33 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=6f705e02 |
7 |
|
8 |
EAPI 6: die and assert called with -n respect nonfatal. |
9 |
|
10 |
See bug 451938. |
11 |
|
12 |
eapi-differences.tex | 4 ++++ |
13 |
pkg-mgr-commands.tex | 33 ++++++++++++++++++++++++++------- |
14 |
2 files changed, 30 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/eapi-differences.tex b/eapi-differences.tex |
17 |
index 6ec5209..2a4f840 100644 |
18 |
--- a/eapi-differences.tex |
19 |
+++ b/eapi-differences.tex |
20 |
@@ -169,6 +169,9 @@ Most utilities die & \compactfeatureref{die-on-failure} & |
21 |
Option \t{-{}-host-root} & \compactfeatureref{host-root-option} & |
22 |
No & No & No & Yes & Yes \\ |
23 |
|
24 |
+\t{die -n} & \compactfeatureref{nonfatal-die} & |
25 |
+ No & No & No & No & Yes \\ |
26 |
+ |
27 |
\t{econf} arguments & \compactfeatureref{econf-options} & |
28 |
& & disable dependency tracking & |
29 |
disable dependency tracking, disable silent rules & |
30 |
@@ -320,6 +323,7 @@ EAPI 6 is EAPI 5 with the following changes: |
31 |
\item Bash version is 4.2, \featureref{bash-version}. |
32 |
\item \t{failglob} is enabled in global scope, \featureref{failglob}. |
33 |
\item \t{einstall} banned, \featureref{banned-commands}. |
34 |
+\item \t{die} and \t{assert} called with \t{-n} respect \t{nonfatal}, \featureref{nonfatal-die}. |
35 |
\end{compactitem} |
36 |
|
37 |
\ChangeWhenAddingAnEAPI{6} |
38 |
|
39 |
diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex |
40 |
index 7e29f3d..ecaee6e 100644 |
41 |
--- a/pkg-mgr-commands.tex |
42 |
+++ b/pkg-mgr-commands.tex |
43 |
@@ -18,9 +18,11 @@ The following commands affect this behaviour: |
44 |
\begin{description} |
45 |
\item[nonfatal] \featurelabel{nonfatal} Executes the remainder of its arguments as a command, |
46 |
preserving the exit status. If this results in a command being called that would normally abort |
47 |
- the build process due to a failure (but not due to an explicit \t{die} or \t{assert} call), |
48 |
- instead a non-zero exit status shall be returned. Only in EAPIs listed in |
49 |
- table~\ref{tab:commands-die-table} as supporting \t{nonfatal}. |
50 |
+ the build process due to a failure, instead a non-zero exit status shall be returned. Only in |
51 |
+ EAPIs listed in table~\ref{tab:commands-die-table} as supporting \t{nonfatal}. |
52 |
+ |
53 |
+ Explicit \t{die} or \t{assert} commands only respect \t{nonfatal} when called with the \t{-n} |
54 |
+ option and in EAPIs supporting this option, see table~\ref{tab:nonfatal-die}. |
55 |
\end{description} |
56 |
|
57 |
\ChangeWhenAddingAnEAPI{6} |
58 |
@@ -117,13 +119,30 @@ stderr or some other appropriate facility. |
59 |
These commands are used when an error is detected that will prevent the build process from |
60 |
completing. Ebuilds must not run any of these commands once the current phase function has returned. |
61 |
\begin{description} |
62 |
-\item[die] Displays a failure message provided in its first and only argument, and then aborts the |
63 |
- build process. \t{die} is \e{not} guaranteed to work correctly if called from a subshell |
64 |
- environment. |
65 |
+\item[die] \featurelabel{nonfatal-die} If called under the \t{nonfatal} command (as per |
66 |
+ section~\ref{sec:failure-behaviour}) and with \t{-n} as its first parameter, displays a failure |
67 |
+ message provided in its following argument and then returns a non-zero exit status. Only in |
68 |
+ EAPIs listed in table~\ref{tab:nonfatal-die} as supporting option~\t{-n}. Otherwise, displays |
69 |
+ a failure message provided in its first and only argument, and then aborts the build process. |
70 |
+ \t{die} is \e{not} guaranteed to work correctly if called from a subshell environment. |
71 |
\item[assert] Checks the value of the shell's pipe status variable, and if any component is non-zero |
72 |
- (indicating failure), calls \t{die} with its first argument as a failure message. |
73 |
+ (indicating failure), calls \t{die}, passing any parameters to it. |
74 |
\end{description} |
75 |
|
76 |
+\ChangeWhenAddingAnEAPI{6} |
77 |
+\begin{centertable}{EAPIs supporting \t{-n} for \t{die} and \t{assert} commands} |
78 |
+ \label{tab:nonfatal-die} |
79 |
+ \begin{tabular}{ l l } |
80 |
+ \toprule |
81 |
+ \multicolumn{1}{c}{\textbf{EAPI}} & |
82 |
+ \multicolumn{1}{c}{\textbf{\t{die} and \t{assert} support \t{-n}?}} \\ |
83 |
+ \midrule |
84 |
+ 0, 1, 2, 3, 4, 5 & No \\ |
85 |
+ 6 & Yes \\ |
86 |
+ \bottomrule |
87 |
+ \end{tabular} |
88 |
+\end{centertable} |
89 |
+ |
90 |
\subsubsection{Build commands} |
91 |
These commands are used during the \t{src\_configure}, \t{src\_compile}, and \t{src\_install} |
92 |
phases to run the package's build commands. Ebuilds must not run any of these commands once the |