Gentoo Archives: gentoo-pms

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-pms@l.g.o
Cc: "Ulrich Müller" <ulm@g.o>
Subject: [gentoo-pms] [PATCH 1/2] names.tex: Specify eclass names
Date: Sat, 14 Jan 2023 09:30:21
Message-Id: 20230114093008.25265-1-ulm@gentoo.org
1 Eclasses may export phase functions prefixed with their name, so
2 ideally we would follow the syntax of Bash (and POSIX) identifiers:
3
4 | A word consisting solely of underscores, digits, and alphabetics
5 | from the portable character set. The first character of a name is
6 | not a digit.
7
8 Because many existing eclasses have a dot or a hyphen in their name,
9 we follow usage in the Gentoo repository instead. (The only historical
10 exception to the above was 64-bit.eclass, not used since 2006 and
11 removed in 2009.)
12
13 An eclass must not be named "default", otherwise names of exported
14 functions would collide with default_<phase-function>.
15
16 Signed-off-by: Ulrich Müller <ulm@g.o>
17 ---
18 eclasses.tex | 5 +++--
19 names.tex | 5 +++++
20 2 files changed, 8 insertions(+), 2 deletions(-)
21
22 diff --git a/eclasses.tex b/eclasses.tex
23 index e23dcd8..0b9b5d4 100644
24 --- a/eclasses.tex
25 +++ b/eclasses.tex
26 @@ -8,8 +8,9 @@ using them. The interpreter is therefore the same, and the same requirements for
27 hold.
28
29 Eclasses must be located in the \t{eclass} directory in the top level of the repository---see
30 -section~\ref{sec:eclass-dir}. Each eclass is a single file named \t{<name>.eclass}, where \t{<name>} is
31 -the name of this eclass, used by \t{inherit} and \t{EXPORT_FUNCTIONS} among other places.
32 +section~\ref{sec:eclass-dir}. Each eclass is a single file named \t{<name>.eclass}, where \t{<name>}
33 +is the name of this eclass, used by \t{inherit} and \t{EXPORT_FUNCTIONS} among other places.
34 +\t{<name>} must be a valid eclass name, as per section~\ref{sec:eclass-names}.
35
36 \section{The inherit Command}
37 \label{sec:inherit}
38 diff --git a/names.tex b/names.tex
39 index 2994719..76fa72d 100644
40 --- a/names.tex
41 +++ b/names.tex
42 @@ -18,6 +18,11 @@ syntax described in section~\ref{sec:version-spec}.
43 \note{A package name does not include the category. The term \i{qualified package name} is used
44 where a \t{category/package} pair is meant.}
45
46 +\subsection{Eclass names}
47 +\label{sec:eclass-names}
48 +An eclass name may contain any of the characters [\t{A-Za-z0-9_.-}]. It must begin with a letter or
49 +an underscore. In addition, an eclass cannot be named \t{default}.
50 +
51 \subsection{Slot names}
52 \label{sec:slot-names}
53 A slot name may contain any of the characters [\t{A-Za-z0-9+_.-}]. It must not begin with a
54 --
55 2.39.0

Replies