From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 15EA913888F for ; Wed, 14 Oct 2015 20:52:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5784621C001; Wed, 14 Oct 2015 20:52:25 +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 E500021C001 for ; Wed, 14 Oct 2015 20:52:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9057D340AB6 for ; Wed, 14 Oct 2015 20:52:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 526D31089 for ; Wed, 14 Oct 2015 20:52:19 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1444855935.8e9d76f934875eb42576b8d650c8980572903b3a.mgorny@gentoo> Subject: [gentoo-commits] proj/pms:eapi-6 commit in: / X-VCS-Repository: proj/pms X-VCS-Files: pkg-mgr-commands.tex X-VCS-Directories: / X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 8e9d76f934875eb42576b8d650c8980572903b3a X-VCS-Branch: eapi-6 Date: Wed, 14 Oct 2015 20:52:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3c36dbbe-9fce-4f72-a7a4-a64baf5ebb68 X-Archives-Hash: 03cf7d0da3245d15820e0db373277a4b commit: 8e9d76f934875eb42576b8d650c8980572903b3a Author: Michał Górny gentoo org> AuthorDate: Wed Oct 14 16:44:02 2015 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Oct 14 20:52:15 2015 +0000 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=8e9d76f9 Explain eapply behavior for EAPI 6 pkg-mgr-commands.tex | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/pkg-mgr-commands.tex b/pkg-mgr-commands.tex index dbdbdfd..1512dac 100644 --- a/pkg-mgr-commands.tex +++ b/pkg-mgr-commands.tex @@ -148,8 +148,11 @@ These commands are used during the \t{src\_prepare} phase to apply patches to th Ebuilds must not run any of these commands once the current phase function has returned. \begin{description} -\item[eapply] \featurelabel{eapply} - Only available in EAPIs listed in table~\ref{tab:patch-commands} as supporting \t{eapply}. +\item[eapply] \featurelabel{eapply} Takes zero or more GNU patch options, followed by one or more + file or directory paths. Processes options and applies all patches found in specified locations + according to Algorithm~\ref{alg:eapply}. If applying the patches fails, it aborts the build + using \t{die}, unless run using \t{nonfatal}, in which case it returns non-zero exit status. + Only available in EAPIs listed in table~\ref{tab:patch-commands} as supporting \t{eapply}. \item[eapply\_user] \featurelabel{eapply-user} Takes no arguments. Package managers supporting it apply user-provided patches to the source tree in the current working directory. Exact behaviour @@ -161,7 +164,31 @@ Ebuilds must not run any of these commands once the current phase function has r \begin{algorithm} \caption{eapply logic} \label{alg:eapply} \begin{algorithmic}[1] -\STATE \COMMENT{WORK IN PROGRESS} +\IF{any parameter is equal to \t{"-{}-"}} + \STATE collect all parameters before the first \t{"-{}-"} in the options array + \STATE collect all parameters after the first \t{"-{}-"} in the files array +\ELSIF{any parameter that begins with a hyphen follows one that does not} + \STATE abort the build process with an error +\ELSE + \STATE collect all parameters beginning with a hyphen in the options array + \STATE collect all remaining parameters in the files array +\ENDIF + +\FOR{\$x in files} + \IF{\$x is a directory} + \FOR{\$f in all files matching \$x/*.diff and \$x/*.patch} + \STATE call \t{patch -p1 -f -g0 --no-backup-if-mismatch "\$\{options[@]\}" "\$f"} + \IF{child process returns with non-zero exit status} + \STATE return immediately with an error + \ENDIF + \ENDFOR + \ELSE + \STATE call \t{patch -p1 -f -g0 --no-backup-if-mismatch "\$\{options[@]\}" "\$x"} + \IF{child process returns with non-zero exit status} + \STATE return immediately with an error + \ENDIF + \ENDIF +\ENDFOR \end{algorithmic} \end{algorithm}