1 |
There seems to be consensus that the EAPI assignment should be in the |
2 |
first non-blank non-comment line, and that the 20 lines limit should |
3 |
be dropped. Please find a new iteration of the patch below. |
4 |
|
5 |
Changes to previous version: |
6 |
- Incorporated Ciaran's wording about position of EAPI assignment. |
7 |
- Dropped 20 lines limit. |
8 |
- Changed description of package manager's action accordingly. (Is it |
9 |
OK to simply say "first non-blank non-comment line" here?) |
10 |
- Distinguish typographically between EAPI as a concept (roman type) |
11 |
and the EAPI environment variable (typewriter type). |
12 |
|
13 |
Ulrich |
14 |
|
15 |
|
16 |
--- a/ebuild-vars.tex |
17 |
+++ b/ebuild-vars.tex |
18 |
@@ -75,7 +75,7 @@ Ebuilds may define any of the following variables: |
19 |
|
20 |
\begin{description} |
21 |
\item[DEPEND] See section~\ref{sec:dependencies}. |
22 |
-\item[EAPI] The EAPI. See below for defaults. |
23 |
+\item[EAPI] The EAPI. See below. |
24 |
\item[PDEPEND] See section~\ref{sec:dependencies}. |
25 |
\item[RDEPEND] See section~\ref{sec:dependencies}. For some EAPIs, \t{RDEPEND} has special behaviour |
26 |
for its value if unset and when used with an eclass. See section~\ref{sec:rdepend-depend} for |
27 |
@@ -124,6 +124,20 @@ ensure that it is unset. |
28 |
If any of these variables are set to invalid values, the package manager's behaviour is undefined; |
29 |
ideally, an error in one ebuild should not prevent operations upon other ebuilds or packages. |
30 |
|
31 |
+If the EAPI is to be specified in an ebuild, the \t{EAPI} variable must be assigned to precisely |
32 |
+once. The assignment must not be preceded by any lines other than blank lines or those that start |
33 |
+with optional whitespace (spaces or tabs) followed by a \t{\#} character, and the line containing |
34 |
+the assignment statement must match the following regular expression: |
35 |
+\begin{verbatim} |
36 |
+^[ \t]*EAPI=(['"]?)([A-Za-z0-9+_.-]*)\1[ \t]*(#.*)?$ |
37 |
+\end{verbatim} |
38 |
+ |
39 |
+The package manager may optionally determine the EAPI of an ebuild by parsing its first non-blank |
40 |
+and non-comment line, using above regular expression. If a recognised EAPI has been determined |
41 |
+such, then the package manager must make sure that the \t{EAPI} value obtained by sourcing the |
42 |
+ebuild with bash is identical to the EAPI obtained by parsing. The ebuild must be treated as |
43 |
+invalid if these values are different. |
44 |
+ |
45 |
\subsection{\t{RDEPEND} value} |
46 |
\label{sec:rdepend-depend} |