1 |
Hi, |
2 |
|
3 |
The council has decided in its April meeting [1] that we should take |
4 |
the route of parsing the EAPI assignment in ebuilds. Please find below |
5 |
a draft wording for PMS. Thanks to dleverton, ferringb, and zmedico |
6 |
for their input. |
7 |
|
8 |
The plan would be to allow optional parsing now, and make it mandatory |
9 |
in future, when EAPI 5 is introduced (i.e. EAPI 5 aware package |
10 |
managers would have to implement it). |
11 |
|
12 |
Ulrich |
13 |
|
14 |
[1] <http://www.gentoo.org/proj/en/council/meeting-logs/20120403.txt> |
15 |
<http://www.gentoo.org/proj/en/council/meeting-logs/20120403-summary.txt> |
16 |
|
17 |
|
18 |
--- a/ebuild-vars.tex |
19 |
+++ b/ebuild-vars.tex |
20 |
@@ -75,7 +75,7 @@ Ebuilds may define any of the following variables: |
21 |
|
22 |
\begin{description} |
23 |
\item[DEPEND] See section~\ref{sec:dependencies}. |
24 |
-\item[EAPI] The EAPI. See below for defaults. |
25 |
+\item[EAPI] The EAPI. See below. |
26 |
\item[PDEPEND] See section~\ref{sec:dependencies}. |
27 |
\item[RDEPEND] See section~\ref{sec:dependencies}. For some EAPIs, \t{RDEPEND} has special behaviour |
28 |
for its value if unset and when used with an eclass. See section~\ref{sec:rdepend-depend} for |
29 |
@@ -124,6 +124,23 @@ ensure that it is unset. |
30 |
If any of these variables are set to invalid values, the package manager's behaviour is undefined; |
31 |
ideally, an error in one ebuild should not prevent operations upon other ebuilds or packages. |
32 |
|
33 |
+To enable parsing of ebuilds for the \t{EAPI} value, the \t{EAPI} assignment statement must adhere |
34 |
+to the following syntax: It must consist of the string \t{EAPI}, followed by an equals sign, |
35 |
+followed by the \t{EAPI} value, optionally enclosed in single or double quotes. The statement must |
36 |
+be on its own line, optionally preceded or followed by whitespace (spaces or tabs), optionally |
37 |
+followed by a comment. Thus, the line must match the following regular expression: |
38 |
+\begin{verbatim} |
39 |
+^[ \t]*EAPI=(['"]?)([A-Za-z0-9+_.-]*)\1[ \t]*(#.*)?$ |
40 |
+\end{verbatim} |
41 |
+If an ebuild contains an \t{EAPI} assignment, the statement must occur within the first 20 lines. |
42 |
+It is an error for an ebuild to contain more than one \t{EAPI} assignment. |
43 |
+ |
44 |
+The package manager may optionally determine the \t{EAPI} of an ebuild by parsing it, using above |
45 |
+regular expression and line number limit. If a recognised \t{EAPI} has been determined such, then |
46 |
+the package manager must make sure that the \t{EAPI} value obtained by sourcing the ebuild with |
47 |
+bash is identical to the one obtained by parsing. The ebuild must be treated as invalid if these |
48 |
+values are different. |
49 |
+ |
50 |
\subsection{\t{RDEPEND} value} |
51 |
\label{sec:rdepend-depend} |