Gentoo Archives: gentoo-commits

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