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 23/28] EAPI 7 provides command fallback for nonfatal.
Date: Wed, 04 Oct 2017 20:48:02
Message-Id: 20171004204712.10391-24-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/622894
2 ---
3 eapi-differences.tex | 5 +++++
4 pkg-mgr-commands.tex | 17 ++++++++++++-----
5 2 files changed, 17 insertions(+), 5 deletions(-)
6
7 diff --git a/eapi-differences.tex b/eapi-differences.tex
8 index 70eadb5..fb469f6 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{nonfatal} function+command & \compactfeatureref{nonfatal-fallback} &
16 + No & No & No & No & Yes \\
17 +
18 \t{domo} install path & \compactfeatureref{domo-path} &
19 \t{\$\{DESTTREE\}\slash share\slash locale} &
20 \t{\$\{DESTTREE\}\slash share\slash locale} &
21 @@ -454,6 +457,8 @@ EAPI 7 is EAPI 6 with the following changes:
22 \item \t{ECLASSDIR} removed, \featureref{eclassdir}.
23 \item \t{domo} installs to \t{/usr/share/locale}, ignoring \t{into}, \featureref{domo-path}.
24 \item \t{dolib} and \t{libopts} banned, \featureref{banned-commands}.
25 +\item \t{nonfatal} defined both as a shell function and external command,
26 + \featureref{nonfatal-fallback}.
27 \end{compactitem}
28
29 \ChangeWhenAddingAnEAPI{7}
30 diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex
31 index f3849fc..c17c9cc 100644
32 --- a/pkg-mgr-commands.tex
33 +++ b/pkg-mgr-commands.tex
34 @@ -22,6 +22,11 @@ The following commands affect this behaviour:
35 the build process due to a failure, instead a non-zero exit status shall be returned. Only in
36 EAPIs listed in table~\ref{tab:commands-die-table} as supporting \t{nonfatal}.
37
38 + \featurelabel{nonfatal-fallback} In EAPIs listed in table~\ref{tab:commands-die-table}
39 + as having \t{nonfatal} defined as both function and external command, the package manager must
40 + provide both implementations to account both for calling in ebuild scope directly, and via
41 + \t{xargs}.
42 +
43 Explicit \t{die} or \t{assert} commands only respect \t{nonfatal} when called with the \t{-n}
44 option and in EAPIs supporting this option, see table~\ref{tab:nonfatal-die}.
45 \end{description}
46 @@ -29,14 +34,16 @@ The following commands affect this behaviour:
47 \ChangeWhenAddingAnEAPI{7}
48 \begin{centertable}{EAPI command failure behaviour}
49 \label{tab:commands-die-table}
50 - \begin{tabular}{lll}
51 + \begin{tabular}{llll}
52 \toprule
53 \multicolumn{1}{c}{\textbf{EAPI}} &
54 - \multicolumn{1}{c}{\textbf{Command failure behaviour}} &
55 - \multicolumn{1}{c}{\textbf{Supports \t{nonfatal}?}} \\
56 + \multicolumn{1}{P{8em}}{\textbf{Command failure behaviour}} &
57 + \multicolumn{1}{P{6em}}{\textbf{Supports \t{nonfatal}?}} &
58 + \multicolumn{1}{P{12em}}{\textbf{\t{nonfatal} as both function and external command?}} \\
59 \midrule
60 - 0, 1, 2, 3 & Non-zero exit & No \\
61 - 4, 5, 6, 7 & Aborts & Yes \\
62 + 0, 1, 2, 3 & Non-zero exit & No & n/a \\
63 + 4, 5, 6 & Aborts & Yes & No \\
64 + 7 & Aborts & Yes & Yes \\
65 \bottomrule
66 \end{tabular}
67 \end{centertable}
68 --
69 2.14.2