From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-844888-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 5CD901384B4
	for <garchives@archives.gentoo.org>; Sun,  8 Nov 2015 19:37:05 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B59C6E084D;
	Sun,  8 Nov 2015 19:36:58 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 020C6E084D
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Nov 2015 19:36:57 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id C78B4340691
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Nov 2015 19:36:55 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id DE48B22CE
	for <gentoo-commits@lists.gentoo.org>; Sun,  8 Nov 2015 19:36:52 +0000 (UTC)
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" <ulm@gentoo.org>
Message-ID: <1447010960.628de448c6a0a7e9b6bac8d206d4288f5bb6933b.ulm@gentoo>
Subject: [gentoo-commits] proj/pms:eapi-6 commit in: /
X-VCS-Repository: proj/pms
X-VCS-Files: eapi-differences.tex ebuild-functions.tex
X-VCS-Directories: /
X-VCS-Committer: ulm
X-VCS-Committer-Name: Ulrich Müller
X-VCS-Revision: 628de448c6a0a7e9b6bac8d206d4288f5bb6933b
X-VCS-Branch: eapi-6
Date: Sun,  8 Nov 2015 19:36:52 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 9e682905-70cb-4d0e-8868-0353fb615d57
X-Archives-Hash: 637ea3c288e1afb286dc51c591ff64a6

commit:     628de448c6a0a7e9b6bac8d206d4288f5bb6933b
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 23 18:41:28 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Nov  8 19:29:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=628de448

EAPI 6 has a default src_prepare.

This adds support for the PATCHES array and for user patches.

Bug: 463692

 eapi-differences.tex |  4 ++++
 ebuild-functions.tex | 39 ++++++++++++++++++++++++++++++---------
 2 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/eapi-differences.tex b/eapi-differences.tex
index 576e3e2..df05c41 100644
--- a/eapi-differences.tex
+++ b/eapi-differences.tex
@@ -91,6 +91,9 @@ Use dependencies & \compactfeatureref{use-deps} &
 \t{src\_prepare} & \compactfeatureref{src-prepare} &
     * & Yes & Yes & Yes & Yes \\
 
+\t{src\_prepare} style & \compactfeatureref{src-prepare} &
+    * & no-op & no-op & no-op & 6 \\
+
 \t{src\_configure} & \compactfeatureref{src-configure} &
     * & Yes & Yes & Yes & Yes \\
 
@@ -322,6 +325,7 @@ EAPI 6 is EAPI 5 with the following changes:
 
 \begin{compactitem}
 \item Bash version is 4.2, \featureref{bash-version}.
+\item Default \t{src\_prepare} no longer a no-op, \featureref{src-prepare-6}.
 \item \t{failglob} is enabled in global scope, \featureref{failglob}.
 \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 dcab29e..34a6a3c 100644
--- a/ebuild-functions.tex
+++ b/ebuild-functions.tex
@@ -124,24 +124,45 @@ src_unpack() {
 \label{sec:src-prepare-function}
 
 \featurelabel{src-prepare} The \t{src\_prepare} function is only called for EAPIs listed in
-table~\ref{tab:src-prepare-table} as supporting it.
-
-The \t{src\_prepare} function can be used for post-unpack source preparation. The default
-implementation does nothing.
+table~\ref{tab:src-prepare-table} as supporting it. The \t{src\_prepare} function can be used for
+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{src\_prepare, format~6} \label{lst:src-prepare-6}
+\begin{verbatim}
+src_prepare() {
+    if declare -p PATCHES | grep -q "^declare -a "; then
+        [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}"
+    else
+        [[ -n ${PATCHES} ]] && eapply ${PATCHES}
+    fi
+    eapply_user
+}
+\end{verbatim}
+\end{listing}
+
+For other EAPIs supporting \t{src\_prepare}, the default implementation used when the ebuild lacks
+the \t{src\_prepare} function is a no-op.
+
 \ChangeWhenAddingAnEAPI{6}
-\begin{centertable}{EAPIs supporting \t{src\_prepare}}
+\begin{centertable}{\t{src\_prepare} support and behaviour for EAPIs}
     \label{tab:src-prepare-table}
-    \begin{tabular}{ll}
+    \begin{tabular}{lll}
       \toprule
       \multicolumn{1}{c}{\textbf{EAPI}} &
-      \multicolumn{1}{c}{\textbf{Supports \t{src\_prepare}?}} \\
+      \multicolumn{1}{c}{\textbf{Supports \t{src\_prepare}?}} &
+      \multicolumn{1}{c}{\textbf{Format}} \\
       \midrule
-      0, 1              & No  \\
-      2, 3, 4, 5, 6     & Yes \\
+      0, 1              & No  & Not applicable \\
+      2, 3, 4, 5        & Yes & no-op          \\
+      6                 & Yes & 6              \\
       \bottomrule
     \end{tabular}
 \end{centertable}