commit:     6b3cf2189ce9e661384b6d4e360e5bf839eb750c
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun May 23 14:37:05 2021 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 25 19:56:56 2021 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=6b3cf218

Rearrange listings of phase functions

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 eapi-differences.tex |  10 ++--
 ebuild-functions.tex | 164 ++++++++++++++++++++++++---------------------------
 2 files changed, 82 insertions(+), 92 deletions(-)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index 08c4e9f..842e09f 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -349,7 +349,7 @@ EAPI 1 is EAPI 0 with the following changes:
 \begin{compactitem}
 \item \t{IUSE} defaults, \featureref{iuse-defaults}.
 \item Slot dependencies, \featureref{slot-deps}.
-\item Different \t{src_compile} implementation, \featureref{src-compile-1}.
+\item Different \t{src_compile} implementation, \featureref{src-compile}.
 \end{compactitem}
 
 \section{EAPI 2}
@@ -362,7 +362,7 @@ EAPI 2 is EAPI 1 with the following changes:
 \item \t{!}\ and \t{!!}\ blockers, \featureref{bang-strength}.
 \item \t{src_prepare}, \featureref{src-prepare}.
 \item \t{src_configure}, \featureref{src-configure}.
-\item Different \t{src_compile} implementation, \featureref{src-compile-2}.
+\item Different \t{src_compile} implementation, \featureref{src-compile}.
 \item \t{default_} phase functions for phases \t{pkg_nofetch}, \t{src_unpack}, 
\t{src_prepare},
     \t{src_configure}, \t{src_compile} and \t{src_test}; 
\featureref{default-phase-funcs}.
 \item \t{doman} language detection by filename, \featureref{doman-langs}.
@@ -391,7 +391,7 @@ EAPI 4 is EAPI 3 with the following changes:
 \item Use dependency defaults, \featureref{use-dep-defaults}.
 \item \t{S} to \t{WORKDIR} fallback restricted, 
\featureref{s-workdir-fallback}.
 \item \t{pkg_pretend}, \featureref{pkg-pretend}.
-\item Default \t{src_install} no longer a no-op, \featureref{src-install-4}.
+\item Default \t{src_install} no longer a no-op, \featureref{src-install}.
 \item \t{pkg_info} can run on non-installed packages, \featureref{pkg-info}.
 \item \t{AA} is gone, \featureref{aa}.
 \item \t{KV} is gone, \featureref{kv}.
@@ -436,8 +436,8 @@ EAPI 6 is EAPI 5 with the following changes:
 \begin{compactitem}
 \item Bash version is 4.2, \featureref{bash-version}.
 \item \t{failglob} is enabled in global scope, \featureref{failglob}.
-\item Default \t{src_prepare} no longer a no-op, \featureref{src-prepare-6}.
-\item Different \t{src_install} implementation, \featureref{src-install-6}.
+\item Default \t{src_prepare} no longer a no-op, \featureref{src-prepare}.
+\item Different \t{src_install} implementation, \featureref{src-install}.
 \item \t{LC_CTYPE} and \t{LC_COLLATE} compatible with POSIX locale, 
\featureref{locale-settings}.
 \item \t{einstall} banned, \featureref{banned-commands}.
 \item \t{die} and \t{assert} called with \t{-n} respect \t{nonfatal}, 
\featureref{nonfatal-die}.

diff --git a/ebuild-functions.tex b/ebuild-functions.tex
index 00fd259..b224e0b 100644
--- a/ebuild-functions.tex
+++ b/ebuild-functions.tex
@@ -120,10 +120,10 @@ The \t{src_unpack} function extracts all of the package's 
sources. In EAPIs lack
 \t{src_prepare}, it may also apply patches and set up the package's build 
system for further use.
 
 The initial working directory must be \t{WORKDIR}, and the default 
implementation used when
-the ebuild lacks the \t{src_unpack} function shall behave as:
+the ebuild lacks the \t{src_unpack} function shall behave as in 
listing~\ref{lst:src-unpack-0}.
 
 \begin{listing}[H]
-\caption{\t{src_unpack}}
+\caption{\t{src_unpack}} \label{lst:src-unpack-0}
 \begin{verbatim}
 src_unpack() {
     if [[ -n ${A} ]]; then
@@ -142,23 +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}.
 
-\featurelabel{src-prepare-6} For EAPIs listed in 
table~\ref{tab:src-prepare-table} as using format
-6, the default implementation used when the ebuild lacks the \t{src_prepare} 
function shall behave
-as:
-
-\begin{listing}[H]
-\caption{\t{src_prepare}, format~6}
-\begin{verbatim}
-src_prepare() {
-    if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
-        [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
-    else
-        [[ -n ${PATCHES} ]] && eapply ${PATCHES}
-    fi
-    eapply_user
-}
-\end{verbatim}
-\end{listing}
+For EAPIs listed in table~\ref{tab:src-prepare-table} as using format~6, the 
default
+implementation used when the ebuild lacks the \t{src_prepare} function shall 
behave as in
+listing~\ref{lst:src-prepare-6}.
 
 For other EAPIs supporting \t{src_prepare}, the default implementation used 
when the ebuild lacks
 the \t{src_prepare} function is a no-op.
@@ -179,6 +165,20 @@ the \t{src_prepare} function is a no-op.
     \end{tabular}
 \end{centertable}
 
+\begin{listing}[H]
+\caption{\t{src_prepare}, format~6} \label{lst:src-prepare-6}
+\begin{verbatim}
+src_prepare() {
+    if [[ $(declare -p PATCHES 2>/dev/null) == "declare -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
@@ -188,18 +188,8 @@ The initial working directory is \t{S}, with an error or 
fallback to \t{WORKDIR}
 section~\ref{sec:s-to-workdir-fallback}.
 
 The \t{src_configure} function configures the package's build environment. The 
default
-implementation used when the ebuild lacks the \t{src_configure} function shall 
behave as:
-
-\begin{listing}[H]
-\caption{\t{src_configure}}
-\begin{verbatim}
-src_configure() {
-    if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
-        econf
-    fi
-}
-\end{verbatim}
-\end{listing}
+implementation used when the ebuild lacks the \t{src_configure} function shall 
behave as in
+listing~\ref{lst:src-configure-2}.
 
 \ChangeWhenAddingAnEAPI{8}
 \begin{centertable}{EAPIs supporting \t{src_configure}}
@@ -215,6 +205,17 @@ src_configure() {
     \end{tabular}
 \end{centertable}
 
+\begin{listing}[H]
+\caption{\t{src_configure}} \label{lst:src-configure-2}
+\begin{verbatim}
+src_configure() {
+    if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
+        econf
+    fi
+}
+\end{verbatim}
+\end{listing}
+
 \subsection{src_compile}
 
 \featurelabel{src-compile} The \t{src_compile} function configures the 
package's build environment
@@ -223,12 +224,28 @@ in EAPIs lacking \t{src_configure}, and builds the 
package in all EAPIs.
 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}.
 
-\featurelabel{src-compile-0} For EAPIs listed in 
table~\ref{tab:src-compile-table} as using format
-0, the default implementation used when the ebuild lacks the \t{src_compile} 
function shall behave
-as:
+For EAPIs listed in table~\ref{tab:src-compile-table} as using format 0, 1 
or~2, the default
+implementation used when the ebuild lacks the \t{src_prepare} function shall 
behave as in
+listing~\ref{lst:src-compile-0}, listing~\ref{lst:src-compile-1} or 
listing~\ref{lst:src-compile-2},
+respectively.
+
+\ChangeWhenAddingAnEAPI{8}
+\begin{centertable}{\t{src_compile} behaviour for EAPIs}
+    \label{tab:src-compile-table}
+    \begin{tabular}{ll}
+      \toprule
+      \multicolumn{1}{c}{\textbf{EAPI}} &
+      \multicolumn{1}{c}{\textbf{Format}} \\
+      \midrule
+      0                   & 0 \\
+      1                   & 1 \\
+      2, 3, 4, 5, 6, 7, 8 & 2 \\
+      \bottomrule
+    \end{tabular}
+\end{centertable}
 
 \begin{listing}[H]
-\caption{\t{src_compile}, format~0}
+\caption{\t{src_compile}, format~0} \label{lst:src-compile-0}
 \begin{verbatim}
 src_compile() {
     if [[ -x ./configure ]]; then
@@ -241,12 +258,8 @@ src_compile() {
 \end{verbatim}
 \end{listing}
 
-\featurelabel{src-compile-1} For EAPIs listed in 
table~\ref{tab:src-compile-table} as using format
-1, the default implementation used when the ebuild lacks the \t{src_compile} 
function shall behave
-as:
-
 \begin{listing}[H]
-\caption{\t{src_compile}, format~1}
+\caption{\t{src_compile}, format~1} \label{lst:src-compile-1}
 \begin{verbatim}
 src_compile() {
     if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
@@ -259,12 +272,8 @@ src_compile() {
 \end{verbatim}
 \end{listing}
 
-\featurelabel{src-compile-2} For EAPIs listed in 
table~\ref{tab:src-compile-table} as using format
-2, the default implementation used when the ebuild lacks the \t{src_compile} 
function shall behave
-as:
-
 \begin{listing}[H]
-\caption{\t{src_compile}, format~2}
+\caption{\t{src_compile}, format~2} \label{lst:src-compile-2}
 \begin{verbatim}
 src_compile() {
     if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
@@ -274,21 +283,6 @@ src_compile() {
 \end{verbatim}
 \end{listing}
 
-\ChangeWhenAddingAnEAPI{8}
-\begin{centertable}{\t{src_compile} behaviour for EAPIs}
-    \label{tab:src-compile-table}
-    \begin{tabular}{ll}
-      \toprule
-      \multicolumn{1}{c}{\textbf{EAPI}} &
-      \multicolumn{1}{c}{\textbf{Format}} \\
-      \midrule
-      0                   & 0 \\
-      1                   & 1 \\
-      2, 3, 4, 5, 6, 7, 8 & 2 \\
-      \bottomrule
-    \end{tabular}
-\end{centertable}
-
 \subsection{src_test}
 
 The \t{src_test} function runs unit tests for the newly built but not yet 
installed package as
@@ -330,12 +324,30 @@ directory specified in \t{D}.
 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}.
 
-\featurelabel{src-install-4} For EAPIs listed in 
table~\ref{tab:src-install-table} as using format
-4, the default implementation used when the ebuild lacks the \t{src_install} 
function shall behave
-as:
+For EAPIs listed in table~\ref{tab:src-install-table} as using format 4 or~6, 
the default
+implementation used when the ebuild lacks the \t{src_prepare} function shall 
behave as in
+listing~\ref{lst:src-install-4} or listing~\ref{lst:src-install-6}, 
respectively.
+
+For other EAPIs, the default implementation used when the ebuild lacks the 
\t{src_install} function
+is a no-op.
+
+\ChangeWhenAddingAnEAPI{8}
+\begin{centertable}{\t{src_install} behaviour for EAPIs}
+    \label{tab:src-install-table}
+    \begin{tabular}{ll}
+      \toprule
+      \multicolumn{1}{c}{\textbf{EAPI}} &
+      \multicolumn{1}{c}{\textbf{Format}} \\
+      \midrule
+      0, 1, 2, 3        & no-op \\
+      4, 5              & 4     \\
+      6, 7, 8           & 6     \\
+      \bottomrule
+    \end{tabular}
+\end{centertable}
 
 \begin{listing}[H]
-\caption{\t{src_install}, format~4}
+\caption{\t{src_install}, format~4} \label{lst:src-install-4}
 \begin{verbatim}
 src_install() {
     if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
@@ -357,12 +369,8 @@ src_install() {
 \end{verbatim}
 \end{listing}
 
-\featurelabel{src-install-6} For EAPIs listed in 
table~\ref{tab:src-install-table} as using format
-6, the default implementation used when the ebuild lacks the \t{src_install} 
function shall behave
-as:
-
 \begin{listing}[H]
-\caption{\t{src_install}, format~6}
+\caption{\t{src_install}, format~6} \label{lst:src-install-6}
 \begin{verbatim}
 src_install() {
     if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
@@ -373,24 +381,6 @@ src_install() {
 \end{verbatim}
 \end{listing}
 
-For other EAPIs, the default implementation used when the ebuild lacks the 
\t{src_install} function
-is a no-op.
-
-\ChangeWhenAddingAnEAPI{8}
-\begin{centertable}{\t{src_install} behaviour for EAPIs}
-    \label{tab:src-install-table}
-    \begin{tabular}{ll}
-      \toprule
-      \multicolumn{1}{c}{\textbf{EAPI}} &
-      \multicolumn{1}{c}{\textbf{Format}} \\
-      \midrule
-      0, 1, 2, 3        & no-op \\
-      4, 5              & 4     \\
-      6, 7, 8           & 6     \\
-      \bottomrule
-    \end{tabular}
-\end{centertable}
-
 \subsection{pkg_preinst}
 
 The \t{pkg_preinst} function performs any special tasks that are required 
immediately before

Reply via email to