diff options
author | Ulrich Müller <ulm@gentoo.org> | 2021-05-16 21:06:02 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2021-06-05 10:55:37 +0200 |
commit | a3693aec2011a666a437e3cea777012ac26fa1b2 (patch) | |
tree | 3f0111fd30c6016f1d20716bf03e461aa98e4c72 | |
parent | Rearrange listings of phase functions (diff) | |
download | pms-a3693aec2011a666a437e3cea777012ac26fa1b2.tar.gz pms-a3693aec2011a666a437e3cea777012ac26fa1b2.tar.bz2 pms-a3693aec2011a666a437e3cea777012ac26fa1b2.zip |
EAPI 8: Default src_prepare doesn't accept options in PATCHES
Also simplify array detection by using the @a operator in parameter
expansion. This feature was introduced in bash-4.4.
Bug: https://bugs.gentoo.org/752486
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | eapi-differences.tex | 3 | ||||
-rw-r--r-- | ebuild-functions.tex | 21 |
2 files changed, 20 insertions, 4 deletions
diff --git a/eapi-differences.tex b/eapi-differences.tex index 842e09f..aeddb6e 100644 --- a/eapi-differences.tex +++ b/eapi-differences.tex @@ -124,7 +124,7 @@ Working directory in \t{pkg_*} phases & \compactfeatureref{phase-function-dir} & * & Yes & Yes & Yes & Yes \\ \t{src_prepare} style & \compactfeatureref{src-prepare} & - * & no-op & 6 & 6 & 6 \\ + * & no-op & 6 & 6 & 8 \\ \t{src_configure} & \compactfeatureref{src-configure} & * & Yes & Yes & Yes & Yes \\ @@ -498,6 +498,7 @@ EAPI 8 is EAPI 7 with the following changes: \item Selective fetch/mirror restriction, \featureref{uri-restrict}. \item \t{IDEPEND}, \featureref{idepend}. \item Empty working directory in \t{pkg_*} phase functions, \featureref{phase-function-dir}. +\item Different \t{src_prepare} implementation, \featureref{src-prepare}. \end{compactitem} \ChangeWhenAddingAnEAPI{8} diff --git a/ebuild-functions.tex b/ebuild-functions.tex index b224e0b..0c745c3 100644 --- a/ebuild-functions.tex +++ b/ebuild-functions.tex @@ -142,9 +142,9 @@ post-unpack source preparation. The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in section~\ref{sec:s-to-workdir-fallback}. -For EAPIs listed in table~\ref{tab:src-prepare-table} as using format~6, the default +For EAPIs listed in table~\ref{tab:src-prepare-table} as using format 6 or~8, the default implementation used when the ebuild lacks the \t{src_prepare} function shall behave as in -listing~\ref{lst:src-prepare-6}. +listing~\ref{lst:src-prepare-6} or listing~\ref{lst:src-prepare-8}, respectively. For other EAPIs supporting \t{src_prepare}, the default implementation used when the ebuild lacks the \t{src_prepare} function is a no-op. @@ -160,7 +160,8 @@ the \t{src_prepare} function is a no-op. \midrule 0, 1 & No & Not applicable \\ 2, 3, 4, 5 & Yes & no-op \\ - 6, 7, 8 & Yes & 6 \\ + 6, 7 & Yes & 6 \\ + 8 & Yes & 8 \\ \bottomrule \end{tabular} \end{centertable} @@ -179,6 +180,20 @@ src_prepare() { \end{verbatim} \end{listing} +\begin{listing}[H] +\caption{\t{src_prepare}, format~8} \label{lst:src-prepare-8} +\begin{verbatim} +src_prepare() { + if [[ ${PATCHES@a} == *a* ]]; then + [[ -n ${PATCHES[@]} ]] && eapply -- "${PATCHES[@]}" + else + [[ -n ${PATCHES} ]] && eapply -- ${PATCHES} + fi + eapply_user +} +\end{verbatim} +\end{listing} + \subsection{src_configure} \featurelabel{src-configure} The \t{src_configure} function is only called for EAPIs listed in |