1 |
commit: 90abb55d4eed07b5caaaf62e9cbe3d077d279ef5 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 31 08:12:12 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 31 08:12:12 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/data/glep.git/commit/?id=90abb55d |
7 |
|
8 |
glep-0082: initial draft for layout.conf GLEP |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
glep-0082.rst | 294 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 294 insertions(+) |
14 |
|
15 |
diff --git a/glep-0082.rst b/glep-0082.rst |
16 |
new file mode 100644 |
17 |
index 0000000..8a1094b |
18 |
--- /dev/null |
19 |
+++ b/glep-0082.rst |
20 |
@@ -0,0 +1,294 @@ |
21 |
+--- |
22 |
+GLEP: 82 |
23 |
+Title: Repository configuration file (layout.conf) |
24 |
+Author: Michał Górny <mgorny@g.o> |
25 |
+Type: Standards Track |
26 |
+Status: Draft |
27 |
+Version: 1.0 |
28 |
+Created: 2021-05-19 |
29 |
+Last-Modified: 2021-05-31 |
30 |
+Post-History: 2021-05-19 |
31 |
+Content-Type: text/x-rst |
32 |
+--- |
33 |
+ |
34 |
+Abstract |
35 |
+======== |
36 |
+ |
37 |
+The ``metadata/layout.conf`` file format is specified as used by Portage |
38 |
+and pkgcore. A standard set of configuration keys is described |
39 |
+including the keys currently used in the Gentoo repository. |
40 |
+ |
41 |
+ |
42 |
+Motivation |
43 |
+========== |
44 |
+ |
45 |
+The ``metadata/layout.conf`` file was first added to the Gentoo |
46 |
+repository in Oct 2011, to facilitate setting of hashes used |
47 |
+in Manifest2 files. In Mar 2012, it was used to indicate the transition |
48 |
+to the new ``md5-dict`` cache format. In Jul 2013, it started being |
49 |
+used to indicate the repository's masters and effectively became |
50 |
+obligatory for all repositories. |
51 |
+ |
52 |
+Today, ``layout.conf`` is used for various repository configuration |
53 |
+knobs that can be expressed as simple values and therefore |
54 |
+do not justify adding new files to the repository. This primarily |
55 |
+involves the configuration of development tools but also includes a few |
56 |
+keys relevant to the behavior of the package manager. |
57 |
+ |
58 |
+However, ``layout.conf`` is currently not covered by any formal |
59 |
+specification. The PMS neglects its existence entirely, and the keys |
60 |
+used are roughly defined by their first use of Portage or pkgcore. |
61 |
+This GLEP aims to overcome this by providing a formal specification |
62 |
+for the file, as well as an up-to-date list of permitted configuration |
63 |
+keys. |
64 |
+ |
65 |
+ |
66 |
+Specification |
67 |
+============= |
68 |
+ |
69 |
+layout.conf file format |
70 |
+----------------------- |
71 |
+ |
72 |
+Every ebuild repository must contain a ``metadata/layout.conf`` file. |
73 |
+The file uses a line-oriented key-value format:: |
74 |
+ |
75 |
+ # comments are allowed |
76 |
+ key = value |
77 |
+ key2 = value2 |
78 |
+ |
79 |
+Lines starting with a hash sign (``#``) represent comments and are |
80 |
+ignored, as are lines consisting entirely of whitespace. |
81 |
+ |
82 |
+Key can be any string and must not contain spaces. The exact form |
83 |
+of value depends on the key. For some keys, the value is permitted |
84 |
+to contain spaces, and it must not be quoted. In some cases an empty |
85 |
+value is permitted. The whitespace between the elements is optional |
86 |
+and is ultimately stripped. Every key must occur no more than once |
87 |
+in the file. |
88 |
+ |
89 |
+ |
90 |
+Configuration keys |
91 |
+------------------ |
92 |
+ |
93 |
+This GLEP specifies a number of standard configuration keys. New keys |
94 |
+may be added to it in the future. It is strongly recommended that any |
95 |
+new keys are added to the specification before being used. |
96 |
+ |
97 |
+The package manager can implement a subset of the listed keys. Unknown |
98 |
+keys should be ignored. |
99 |
+ |
100 |
+ |
101 |
+The following keys must be present in a ``layout.conf`` file: |
102 |
+ |
103 |
+masters = <space-separated repository names> |
104 |
+ Specifies the master repositories of this repository. For stand-alone |
105 |
+ repositories, this must be set to an empty value. Otherwise, it can |
106 |
+ list one or more repositories, separated by spaces. This key must |
107 |
+ be specified. |
108 |
+ |
109 |
+ Examples:: |
110 |
+ |
111 |
+ # most common case |
112 |
+ masters = gentoo |
113 |
+ # stand-alone repository |
114 |
+ masters = |
115 |
+ # multiple masters |
116 |
+ masters = gentoo python |
117 |
+ |
118 |
+ |
119 |
+The following keys are optional: |
120 |
+ |
121 |
+manifest-hashes = <space-separated hash names> |
122 |
+ Specifies the list of hashes that should be used for new distfiles |
123 |
+ in the Manifest files. The development tools may create a subset |
124 |
+ of the specified hashes if it is not updating the checksums for |
125 |
+ the specified distfile, or does not support the hash in question. |
126 |
+ The hash names are specified in GLEP 74. [#GLEP74]_ The default |
127 |
+ set of hashes is implementation-defined. |
128 |
+ |
129 |
+ Example:: |
130 |
+ |
131 |
+ manifest-hashes = BLAKE2B SHA512 |
132 |
+ |
133 |
+manifest-required-hashes = <space-separated hash names> |
134 |
+ Specifies the list of hashes that must be used in Manifest files. |
135 |
+ The development tools must support all the hashes listed there, |
136 |
+ and update distfile checksums to use these hashes (refetching |
137 |
+ if necessary). This must be a subset of manifest-hashes. If not |
138 |
+ specified, all hashes from manifest-hashes (or the default set) |
139 |
+ are considered required. |
140 |
+ |
141 |
+use-manifests = ``strict``, ``true`` or ``false`` |
142 |
+ Indicates the policy for creating and using Manifest files. If set |
143 |
+ to ``strict``, Manifest files are created and files are required to |
144 |
+ match digests found in Manifests. If set to ``true``, Manifests |
145 |
+ are created but digest mismatches are ignored. If set to ``false``, |
146 |
+ Manifests are not used at all. The default is ``strict``. |
147 |
+ |
148 |
+update-changelog = ``true`` or ``false`` |
149 |
+ Indicates whether the development tools should write ChangeLog files. |
150 |
+ The default is ``false``. |
151 |
+ |
152 |
+cache-formats = <space-separated format names> |
153 |
+ Specifies one or more cache formats used by the repository. |
154 |
+ The currently defined values are ``pms`` for the original format |
155 |
+ specified in the PMS and ``md5-dict`` for the md5-dict format |
156 |
+ introduced in Portage 2.2.0_alpha68. The default is |
157 |
+ implementation-defined. |
158 |
+ |
159 |
+ Examples:: |
160 |
+ |
161 |
+ # modern repo |
162 |
+ cache-formats = md5-dict |
163 |
+ # backwards compatibility case |
164 |
+ cache-formats = md5-dict pms |
165 |
+ |
166 |
+eapis-deprecated = <space-separated EAPI names> |
167 |
+ Specifies one or more EAPIs that are to be considered deprecated |
168 |
+ by the development tools for use in ebuilds, i.e. their use should |
169 |
+ trigger a warning. If not specified, no EAPIs are deprecated. |
170 |
+ |
171 |
+ Example:: |
172 |
+ |
173 |
+ eapis-deprecated = 0 1 2 3 4 |
174 |
+ |
175 |
+eapis-banned = <space-separated EAPI names> |
176 |
+ Specifies one or more EAPIs that are to be considered banned |
177 |
+ by the development tools for use in ebuilds, i.e. their use should |
178 |
+ be blocked. If not specified, no EAPIs are banned. |
179 |
+ |
180 |
+repo-name = <string> |
181 |
+ Specifies the repository name. If specified, it must be equal |
182 |
+ to the contents of ``profiles/repo_name``. If not specified, |
183 |
+ it defaults to the same value. Discouraged. |
184 |
+ |
185 |
+aliases = <space-separated names> |
186 |
+ Specified one or more additional names that can be used to reference |
187 |
+ the repository (e.g. in repository dependencies). If not specified, |
188 |
+ no aliases are defined. |
189 |
+ |
190 |
+ Example:: |
191 |
+ |
192 |
+ # gen2 is a fork of Gentoo that can be used in place of the Gentoo |
193 |
+ # repository |
194 |
+ repo-name = gen2 |
195 |
+ aliases = gentoo |
196 |
+ |
197 |
+thin-manifests = ``true`` or ``false`` |
198 |
+ If enabled, Manifest files in the package directory must contain only |
199 |
+ ``DIST`` entries. If disabled, Manifest files in the package |
200 |
+ directory must list digests for all files found in the package |
201 |
+ directory and the files directory. The default is ``false``. |
202 |
+ |
203 |
+sign-commits = ``true`` or ``false`` |
204 |
+ Indicates whether git commits are to be signed (using ``git commit |
205 |
+ --gpg-sign``. The default is ``false``. |
206 |
+ |
207 |
+sign-manifests = ``true`` or ``false`` |
208 |
+ Indicates whether individual package Manifests should be PGP-signed. |
209 |
+ Note that this refers to the historical behavior of signing individual |
210 |
+ Manifests, not the GLEP 74 behavior of signing the top-level Manifest. |
211 |
+ [#GLEP74]_ The default is ``true`` if PGP signing is configured. |
212 |
+ |
213 |
+properties-allowed = <space-separated property tokens> |
214 |
+ Specifies the list of ``PROPERTIES`` tokens that are permitted |
215 |
+ to be used in ebuilds. If present, the development tools should issue |
216 |
+ a warning if ``PROPERTIES`` contains any tokens that are not listed |
217 |
+ here. If not specified, all tokens are permitted. |
218 |
+ |
219 |
+ Example:: |
220 |
+ |
221 |
+ properties-allowed = live |
222 |
+ |
223 |
+restrict-allowed = <space-separated restrict tokens> |
224 |
+ Same as properties-allowed, except for ``RESTRICT``. |
225 |
+ |
226 |
+profile-formats = <space-separated format names> |
227 |
+ Specifies the format used by profiles and/or extensions to it. |
228 |
+ The default is ``pms`` indicating the format specified in the PMS. |
229 |
+ Other values are implementation-defined. |
230 |
+ |
231 |
+ Examples:: |
232 |
+ |
233 |
+ profile-formats = portage-1 |
234 |
+ profile-formats = portage-2 profile-set |
235 |
+ |
236 |
+ |
237 |
+Complete example |
238 |
+---------------- |
239 |
+ |
240 |
+The following is an example configuration for a git repository with |
241 |
+Gentoo set as a master:: |
242 |
+ |
243 |
+ masters = gentoo |
244 |
+ |
245 |
+ # git: do not use ChangeLog, use thin, unsigned Manifests |
246 |
+ update-changelog = false |
247 |
+ thin-manifests = true |
248 |
+ sign-manifests = false |
249 |
+ |
250 |
+ # force the new md5-dict cache format |
251 |
+ cache-formats = md5-dict |
252 |
+ |
253 |
+ |
254 |
+Rationale |
255 |
+========= |
256 |
+ |
257 |
+This GLEP is written almost 10 years after ``layout.conf`` was |
258 |
+originally introduced. This made it necessary to write it in such a way |
259 |
+that both the modern and historical implementations in Portage |
260 |
+and pkgcore, as well as the use in the Gentoo repository |
261 |
+and a reasonably large subset of the other repositories would remain |
262 |
+compliant. |
263 |
+ |
264 |
+The historical default of assuming ``masters = gentoo`` when unspecified |
265 |
+is omitted as it is not portable and verbosely deprecated for many |
266 |
+years in Portage. All repositories are required to explicitly specify |
267 |
+their masters, or an empty value if they are stand-alone. |
268 |
+ |
269 |
+The default for Manifest hashes and cache formats are left to be |
270 |
+implementation-defined, as the defaults changed over time and do not |
271 |
+match between package managers. In particular, Portage attempts to |
272 |
+autodetect the cache format currently used in a given repository. |
273 |
+ |
274 |
+The repo-name key has been originally added as an alternative to |
275 |
+``profiles/repo_name``. However, the latter file is still required |
276 |
+for PMS compliance. Furthermore, given that it is much easier to parse, |
277 |
+there seems to be no appealing reason to work towards replacing that |
278 |
+file. This means that for all practical reasons, the repo-name key |
279 |
+is redundant and is listed here for completeness only. |
280 |
+ |
281 |
+The profile-formats key has been introduced to permit Portage-specific |
282 |
+extensions to the profile directory without having to introduce custom |
283 |
+EAPIs. The exact extensions are considered outside the scope of this |
284 |
+specification. |
285 |
+ |
286 |
+ |
287 |
+Backwards Compatibility |
288 |
+======================= |
289 |
+ |
290 |
+The existing implementations found in Portage and pkgcore conform |
291 |
+to this specification, so does the ``metadata/layout.conf`` file |
292 |
+found in the Gentoo repository. |
293 |
+ |
294 |
+ |
295 |
+Reference Implementation |
296 |
+======================== |
297 |
+ |
298 |
+The support for ``metadata/layout.conf`` is already a part of Portage |
299 |
+and pkgcore. |
300 |
+ |
301 |
+ |
302 |
+References |
303 |
+========== |
304 |
+ |
305 |
+.. [#GLEP74] GLEP 74: Full-tree verification using Manifest files |
306 |
+ (https://www.gentoo.org/glep/glep-0074.html) |
307 |
+ |
308 |
+ |
309 |
+Copyright |
310 |
+========= |
311 |
+ |
312 |
+This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 |
313 |
+International License. To view a copy of this license, visit |
314 |
+https://creativecommons.org/licenses/by-sa/4.0/. |