If the EAPI is to be specified in an ebuild, the EAPI variable must be assigned to precisely once. The assignment must not be preceded by any lines other than blank lines or those that start with optional whitespace (spaces or tabs) followed by a # character, and the line containing the assignment statement must match the following regular expression: ^[ \t]*EAPI=(['"]?)([A-Za-z0-9+_.-]*)\1[ \t]*(#.*)?$ The package manager may optionally determine the EAPI of an ebuild by parsing its first non-blank and non-comment line, using above regular expression. If a recognised EAPI has been determined such, then the package manager must make sure that the EAPI value obtained by sourcing the ebuild with bash is identical to the EAPI obtained by parsing. The ebuild must be treated as invalid if these values are different. From c52a11a8e28eb81c6f40e0edcfea65c68bcb2a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= Date: Sun, 15 Apr 2012 12:15:46 +0200 Subject: [PATCH] Specify syntax of EAPI assignment for parsing by package managers. --- ebuild-vars.tex | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/ebuild-vars.tex b/ebuild-vars.tex index d971234..f3b72bf 100644 --- a/ebuild-vars.tex +++ b/ebuild-vars.tex @@ -75,7 +75,7 @@ Ebuilds may define any of the following variables: \begin{description} \item[DEPEND] See section~\ref{sec:dependencies}. -\item[EAPI] The EAPI. See below for defaults. +\item[EAPI] The EAPI. See below. \item[PDEPEND] See section~\ref{sec:dependencies}. \item[RDEPEND] See section~\ref{sec:dependencies}. For some EAPIs, \t{RDEPEND} has special behaviour for its value if unset and when used with an eclass. See section~\ref{sec:rdepend-depend} for @@ -124,6 +124,20 @@ ensure that it is unset. If any of these variables are set to invalid values, the package manager's behaviour is undefined; ideally, an error in one ebuild should not prevent operations upon other ebuilds or packages. +If the EAPI is to be specified in an ebuild, the \t{EAPI} variable must be assigned to precisely +once. The assignment must not be preceded by any lines other than blank lines or those that start +with optional whitespace (spaces or tabs) followed by a \t{\#} character, and the line containing +the assignment statement must match the following regular expression: +\begin{verbatim} +^[ \t]*EAPI=(['"]?)([A-Za-z0-9+_.-]*)\1[ \t]*(#.*)?$ +\end{verbatim} + +The package manager may optionally determine the EAPI of an ebuild by parsing its first non-blank +and non-comment line, using above regular expression. If a recognised EAPI has been determined +such, then the package manager must make sure that the \t{EAPI} value obtained by sourcing the +ebuild with bash is identical to the EAPI obtained by parsing. The ebuild must be treated as +invalid if these values are different. + \subsection{\t{RDEPEND} value} \label{sec:rdepend-depend} -- 1.7.8.5