Gentoo Archives: gentoo-pms

From: Brian Harring <ferringb@×××××.com>
To: gentoo-pms@l.g.o
Cc: Brian Harring <ferringb@×××××.com>
Subject: [gentoo-pms] [PATCH] Allocate __* for package manager internals, blacklist it for ebuilds.
Date: Tue, 11 Sep 2012 01:40:19
Message-Id: 1347327593-1144-1-git-send-email-ferringb@gmail.com
1 To varying degrees, existing PMs use names that aren't prefixed in some
2 fashion indicating it's an internal- the end result being ebuilds/eclasses
3 that rely on a PM internal (both bad for alternate PMs, and bad should
4 that internal change).
5
6 Further, the lack of a standardized namespace for the PMs internals means
7 QA tools must maintain their own lists. As such, allocate __* for the PM
8 to use for it's internal functionality and variables.
9
10 This currently conflicts with the following in gentoo-x86:
11
12 __do_sed_fix
13 __list_needed_subdirectories
14 __prepare_module
15 ___ECLASS_ONCE_AUTOTOOLS
16
17 All of these are trivial to change.
18 ---
19 ebuild-env-vars.tex | 9 +++++++++
20 ebuild-functions.tex | 6 ++++++
21 ebuild-vars.tex | 6 ++++++
22 3 files changed, 21 insertions(+)
23
24 diff --git a/ebuild-env-vars.tex b/ebuild-env-vars.tex
25 index 9597e67..1036f6f 100644
26 --- a/ebuild-env-vars.tex
27 +++ b/ebuild-env-vars.tex
28 @@ -1,3 +1,12 @@
29 +\section{Package Manager Internals}
30 +\label{sec:package-manager-internal-names}
31 +
32 +The package manager, unless stated otherwise in this document, must name all internal variables
33 +and functions starting with \_\_; the purpose of this is to ensure that no ebuild or eclass
34 +accidentally relies on a package manager implementation detail. Variables and functions
35 +exported by bash, or bash the systems bashrc or profiles are exempt from this requirement; this
36 +applies strictly to the package managers implementation.
37 +
38 \section{Defined Variables}
39 \label{sec:ebuild-env-vars}
40
41 diff --git a/ebuild-functions.tex b/ebuild-functions.tex
42 index 9836e33..a50ccdc 100644
43 --- a/ebuild-functions.tex
44 +++ b/ebuild-functions.tex
45 @@ -1,6 +1,12 @@
46 \chapter{Ebuild-defined Functions}
47 \label{sec:ebuild-functions}
48
49 +\section{Allowed Names}
50 +\label{sec:ebuild-function-names}
51 +
52 +All ebuild and eclass functions must not start with \_\_; that space is reserved for package
53 +manager internal functions.
54 +
55 \section{List of Functions}
56 \label{sec:functions}
57
58 diff --git a/ebuild-vars.tex b/ebuild-vars.tex
59 index 53de53d..dfe71dd 100644
60 --- a/ebuild-vars.tex
61 +++ b/ebuild-vars.tex
62 @@ -8,6 +8,12 @@ If any of these variables are set to invalid values, or if any of the mandatory
63 undefined, the package manager's behaviour is undefined; ideally, an error in one ebuild should not
64 prevent operations upon other ebuilds or packages.
65
66 +\section{Allowed Names}
67 +\label{sec:ebuild-variable-names}
68 +
69 +All ebuild and eclass defined variables must not start with \_\_; that namespace is reserved for
70 +the package managers internals.
71 +
72 \section{Metadata invariance}
73 \label{sec:metadata-invariance}
74
75 --
76 1.7.12

Replies