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 09/28] EAPI 7 no longer adds trailing slash to ROOT, EROOT, D, ED.
Date: Wed, 04 Oct 2017 20:47:40
Message-Id: 20171004204712.10391-10-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/465772
2 ---
3 eapi-differences.tex | 5 +++++
4 ebuild-env-vars.tex | 58 ++++++++++++++++++++++++++++++++++++++++++----------
5 2 files changed, 52 insertions(+), 11 deletions(-)
6
7 diff --git a/eapi-differences.tex b/eapi-differences.tex
8 index 055e6c6..939c501 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 +Trailing slash in \t{ROOT}, \t{D}... & \compactfeatureref{trailing-slash} &
16 + Yes & Yes & Yes & Yes & No \\
17 +
18 Output cmds can use stdout & \compactfeatureref{output-no-stdout} &
19 Yes & Yes & Yes & Yes & No \\
20
21 @@ -395,6 +398,8 @@ EAPI 7 is EAPI 6 with the following changes:
22 \item Version manipulation and comparison functions added, \featureref{ver-functions}.
23 \item \t{eqawarn} added, \featureref{eqawarn}.
24 \item Output commands can no longer use stdout, \featureref{output-no-stdout}.
25 +\item \t{ROOT}, \t{EROOT}, \t{D}, \t{ED} no longer end with a trailing slash,
26 + \featureref{trailing-slash}.
27 \end{compactitem}
28
29 \ChangeWhenAddingAnEAPI{7}
30 diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
31 index 1851aba..fe61ac5 100644
32 --- a/ebuild-env-vars.tex
33 +++ b/ebuild-env-vars.tex
34 @@ -121,14 +121,15 @@ variable.
35 The absolute path to the root directory into which the package is to be merged. Phases which run
36 with full filesystem access must not touch any files outside of the directory given in
37 \t{ROOT}\@. Also of note is that in a cross-compiling environment, binaries inside of \t{ROOT}
38 - will not be executable on the build machine, so ebuilds must not call them. \t{ROOT} must be
39 - non-empty and end in a trailing slash. \\
40 + will not be executable on the build machine, so ebuilds must not call them. The presence of
41 + a trailing slash is EAPI-dependent as listed in table~\ref{tab:trailing-slash}. \\
42 \t{EROOT} &
43 \t{pkg_*} &
44 No &
45 - Contains the path \t{\$\{ROOT\%/\}\$\{EPREFIX\}/} for convenience. See also the
46 - \t{EPREFIX} variable. Only for EAPIs listed in table~\ref{tab:offset-env-vars-table} as
47 - supporting \t{EROOT}. \\
48 + Contains the concatenation of the paths in \t{ROOT} and \t{EPREFIX} variables, for convenience.
49 + See also the \t{EPREFIX} variable. Only for EAPIs listed
50 + in table~\ref{tab:offset-env-vars-table} as supporting \t{EROOT}. The presence of a trailing
51 + slash EAPI-dependent as listed in table~\ref{tab:trailing-slash}. \\
52 \t{T} &
53 All &
54 Partially\footnote{Consistent and preserved across a single connected sequence of install or
55 @@ -159,18 +160,21 @@ variable.
56 \t{src_install} &
57 No &
58 Contains the full path to the image directory into which the package should be installed.
59 - Must be non-empty and end in a trailing slash. \\
60 + The presence of a trailing slash is EAPI-dependent as listed in table~\ref{tab:trailing-slash}.
61 + \\
62 \t{D} (continued) &
63 \t{pkg_preinst}, \t{pkg_postinst} &
64 Yes &
65 - Contains the full path to the image that is about to be or has just been merged. Must be
66 - non-empty and end in a trailing slash. \\
67 + Contains the full path to the image that is about to be or has just been merged.
68 + The presence of a trailing slash is EAPI-dependent as listed in table~\ref{tab:trailing-slash}.
69 + \\
70 \t{ED} &
71 \t{src_install}, \t{pkg_preinst}, \t{pkg_postinst} &
72 See \t{D} &
73 - Contains the path \t{\$\{D\%/\}\$\{EPREFIX\}/} for convenience. See also the
74 - \t{EPREFIX} variable. Only for EAPIs listed in table~\ref{tab:offset-env-vars-table} as
75 - supporting \t{ED}. \\
76 + Contains the concatenation of the paths in \t{D} and \t{EPREFIX} variables, for convenience.
77 + See also the \t{EPREFIX} variable. Only for EAPIs listed
78 + in table~\ref{tab:offset-env-vars-table} as supporting \t{ED}. The presence of a trailing
79 + slash EAPI-dependent as listed in table~\ref{tab:trailing-slash}. \\
80 \t{DESTTREE} &
81 \t{src_install} &
82 No &
83 @@ -420,6 +424,38 @@ behaviour of offset-prefix aware and agnostic is the same when \t{EPREFIX} is se
84 string in offset-prefix aware EAPIs. The latter do have the variables \t{ED} and \t{EROOT} properly
85 set, though.
86
87 +\subsection{Path variables and trailing slash}
88 +\label{sec:trailing-slash}
89 +
90 +Unless specified otherwise, the paths provided through package manager variables do not end with
91 +a trailing slash and can not be empty. A few exceptions to that rule are listed
92 +in table~\ref{tab:trailing-slash} along with applicable EAPIs.
93 +
94 +For EAPIs where those variables are defined to always end with a trailing slash, the package manager
95 +guarantees that a trailing slash will always be appended to the path in question. If the path
96 +specifies the system root directory, it will consist of a single slash (\t{/}).
97 +
98 +\featurelabel{trailing-slash} For EAPIs where those variables are defined to never end with
99 +a trailing slash, the package manager guarantees that a trailing slash will never be present.
100 +If the path specifies the system root directory, it will be empty.
101 +
102 +\ChangeWhenAddingAnEAPI{7}
103 +\begin{centertable}{Variables that always or never end with a trailing slash}
104 + \label{tab:trailing-slash}
105 + \begin{tabular}{lll}
106 + \toprule
107 + \multicolumn{1}{c}{\textbf{EAPI}} &
108 + \multicolumn{2}{c}{\textbf{Ends with a trailing slash?}} \\
109 + &
110 + \t{ROOT}, \t{EROOT} &
111 + \t{D}, \t{ED} \\
112 + \midrule
113 + 0, 1, 2, 3, 4, 5, 6 & always & always \\
114 + 7 & never & never \\
115 + \bottomrule
116 + \end{tabular}
117 +\end{centertable}
118 +
119 % vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :
120
121 %%% Local Variables:
122 --
123 2.14.2