1 |
commit: 35bfeddf102e90f7d67b9aacc7537e63d1f281d7 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 16 19:06:02 2021 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 25 20:00:27 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=35bfeddf |
7 |
|
8 |
EAPI 8: Default src_prepare doesn't accept options in PATCHES |
9 |
|
10 |
Also simplify array detection by using the @a operator in parameter |
11 |
expansion. This feature was introduced in bash-4.4. |
12 |
|
13 |
Bug: https://bugs.gentoo.org/752486 |
14 |
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> |
15 |
|
16 |
eapi-differences.tex | 3 ++- |
17 |
ebuild-functions.tex | 21 ++++++++++++++++++--- |
18 |
2 files changed, 20 insertions(+), 4 deletions(-) |
19 |
|
20 |
diff --git a/eapi-differences.tex b/eapi-differences.tex |
21 |
index 842e09f..aeddb6e 100644 |
22 |
--- a/eapi-differences.tex |
23 |
+++ b/eapi-differences.tex |
24 |
@@ -124,7 +124,7 @@ Working directory in \t{pkg_*} phases & \compactfeatureref{phase-function-dir} & |
25 |
* & Yes & Yes & Yes & Yes \\ |
26 |
|
27 |
\t{src_prepare} style & \compactfeatureref{src-prepare} & |
28 |
- * & no-op & 6 & 6 & 6 \\ |
29 |
+ * & no-op & 6 & 6 & 8 \\ |
30 |
|
31 |
\t{src_configure} & \compactfeatureref{src-configure} & |
32 |
* & Yes & Yes & Yes & Yes \\ |
33 |
@@ -498,6 +498,7 @@ EAPI 8 is EAPI 7 with the following changes: |
34 |
\item Selective fetch/mirror restriction, \featureref{uri-restrict}. |
35 |
\item \t{IDEPEND}, \featureref{idepend}. |
36 |
\item Empty working directory in \t{pkg_*} phase functions, \featureref{phase-function-dir}. |
37 |
+\item Different \t{src_prepare} implementation, \featureref{src-prepare}. |
38 |
\end{compactitem} |
39 |
|
40 |
\ChangeWhenAddingAnEAPI{8} |
41 |
|
42 |
diff --git a/ebuild-functions.tex b/ebuild-functions.tex |
43 |
index b224e0b..0c745c3 100644 |
44 |
--- a/ebuild-functions.tex |
45 |
+++ b/ebuild-functions.tex |
46 |
@@ -142,9 +142,9 @@ post-unpack source preparation. |
47 |
The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in |
48 |
section~\ref{sec:s-to-workdir-fallback}. |
49 |
|
50 |
-For EAPIs listed in table~\ref{tab:src-prepare-table} as using format~6, the default |
51 |
+For EAPIs listed in table~\ref{tab:src-prepare-table} as using format 6 or~8, the default |
52 |
implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in |
53 |
-listing~\ref{lst:src-prepare-6}. |
54 |
+listing~\ref{lst:src-prepare-6} or listing~\ref{lst:src-prepare-8}, respectively. |
55 |
|
56 |
For other EAPIs supporting \t{src_prepare}, the default implementation used when the ebuild lacks |
57 |
the \t{src_prepare} function is a no-op. |
58 |
@@ -160,7 +160,8 @@ the \t{src_prepare} function is a no-op. |
59 |
\midrule |
60 |
0, 1 & No & Not applicable \\ |
61 |
2, 3, 4, 5 & Yes & no-op \\ |
62 |
- 6, 7, 8 & Yes & 6 \\ |
63 |
+ 6, 7 & Yes & 6 \\ |
64 |
+ 8 & Yes & 8 \\ |
65 |
\bottomrule |
66 |
\end{tabular} |
67 |
\end{centertable} |
68 |
@@ -179,6 +180,20 @@ src_prepare() { |
69 |
\end{verbatim} |
70 |
\end{listing} |
71 |
|
72 |
+\begin{listing}[H] |
73 |
+\caption{\t{src_prepare}, format~8} \label{lst:src-prepare-8} |
74 |
+\begin{verbatim} |
75 |
+src_prepare() { |
76 |
+ if [[ ${PATCHES@a} == *a* ]]; then |
77 |
+ [[ -n ${PATCHES[@]} ]] && eapply -- "${PATCHES[@]}" |
78 |
+ else |
79 |
+ [[ -n ${PATCHES} ]] && eapply -- ${PATCHES} |
80 |
+ fi |
81 |
+ eapply_user |
82 |
+} |
83 |
+\end{verbatim} |
84 |
+\end{listing} |
85 |
+ |
86 |
\subsection{src_configure} |
87 |
|
88 |
\featurelabel{src-configure} The \t{src_configure} function is only called for EAPIs listed in |