| 1 | GLEP: 29 |
1 | GLEP: 29 |
| 2 | Title: USE flag groups |
2 | Title: USE flag groups |
| 3 | Version: $Revision: 1.3 $ |
3 | Version: $Revision: 1.5 $ |
| 4 | Author: Ciaran McCreesh <ciaranm@gentoo.org> |
4 | Author: Ciaran McCreesh <ciaranm@gentoo.org> |
| 5 | Last-Modified: $Date: 2004/10/18 15:32:10 $ |
5 | Last-Modified: $Date: 2005/06/24 21:36:04 $ |
| 6 | Status: Draft |
6 | Status: Draft |
| 7 | Type: Standards Track |
7 | Type: Standards Track |
| 8 | Content-Type: text/x-rst |
8 | Content-Type: text/x-rst |
| 9 | Created: 19-August-2004 |
9 | Created: 19-August-2004 |
| 10 | Post-Date: 21-August-2004, 18-October-2004 |
10 | Post-Date: 21-August-2004, 18-October-2004, 25-October-2004, 24-July-2005 |
|
|
11 | |
|
|
12 | Status |
|
|
13 | ====== |
|
|
14 | |
|
|
15 | Withdrawn by request of the author. |
| 11 | |
16 | |
| 12 | Abstract |
17 | Abstract |
| 13 | ======== |
18 | ======== |
| 14 | |
19 | |
| 15 | Currently, USE flags must be selected on a one-by-one basis, making it |
20 | Currently, USE flags must be selected on a one-by-one basis, making it |
| … | |
… | |
| 25 | environment to be built -- a server, for example, should not typically |
30 | environment to be built -- a server, for example, should not typically |
| 26 | have an X11 server or sound support, whereas both would be desirable on |
31 | have an X11 server or sound support, whereas both would be desirable on |
| 27 | most desktop systems. |
32 | most desktop systems. |
| 28 | |
33 | |
| 29 | With several hundred USE flags available, deciding upon which USE flags to |
34 | With several hundred USE flags available, deciding upon which USE flags to |
| 30 | enable and which to disable can take a long time. This GLEP proposes a |
35 | enable and which to disable can take a long time. Although the default USE |
|
|
36 | flag settings are reasonable, they are clearly not appropriate for every |
|
|
37 | system. In addition, using "-*" to disable all default USE flags can be |
|
|
38 | risky as certain USE flags should not generally be turned off. This GLEP |
| 31 | mechanism for grouping USE flags to simplify selection. |
39 | proposes a mechanism for grouping USE flags to simplify selection and to |
|
|
40 | make USE="-*" less dangerous. |
| 32 | |
41 | |
| 33 | Specification |
42 | Specification |
| 34 | ============= |
43 | ============= |
| 35 | |
44 | |
| 36 | Group Specification |
45 | Group Specification |
| 37 | ------------------- |
46 | ------------------- |
| 38 | |
47 | |
| 39 | A group shall consist of one or more USE flags. These groups are defined |
48 | A group shall consist of one or more tokens. Each token may be a USE flag, |
| 40 | in ``${PORTDIR}/profiles/use.groups``. It is proposed that uppercase names |
49 | a -USE flag, a reference to another group or a negative reference to |
| 41 | only are used for groups to keep them visually distinct from normal USE |
50 | another group. |
|
|
51 | |
|
|
52 | These groups are defined in ``${PORTDIR}/profiles/use.groups``. It is |
|
|
53 | proposed that uppercase names only are used for groups to keep them |
|
|
54 | visually distinct from normal USE flags (almost all USE flags are |
| 42 | flags, although this should not be enforced programatically. The file |
55 | lowercase), although this should not been forced programmatically. The |
| 43 | should be similar in format to the existing use.* files. In the following, |
56 | file should be similar in format to the existing use.* files. In the |
| 44 | ``SOME_GROUP`` and ``OTHER_GROUP`` are group names, and ``flag1`` through |
57 | following, ``SOME_GROUP`` and ``OTHER_GROUP`` are group names, and |
| 45 | ``flag5`` are USE flag names: |
58 | ``flag1`` through ``flag5`` are USE flag names: |
| 46 | |
59 | |
| 47 | :: |
60 | :: |
| 48 | |
61 | |
| 49 | SOME_GROUP flag1 flag2 flag3 |
62 | SOME_GROUP flag1 flag2 flag3 |
| 50 | OTHER_GROUP flag2 flag4 |
63 | OTHER_GROUP flag2 flag4 |
| 51 | |
64 | |
| 52 | Groups may recursively include other groups. For consistency with GLEP 23 |
65 | Groups may recursively include other groups. For consistency with GLEP 23 |
| 53 | [1], it is proposed that group names are prefixed with an 'at' symbol (@): |
66 | [1]_, it is proposed that group names have their name prefixed with an |
|
|
67 | 'at' symbol (@): |
| 54 | |
68 | |
| 55 | :: |
69 | :: |
| 56 | |
70 | |
| 57 | GROUP1 flag1 |
71 | GROUP1 flag1 |
| 58 | GROUP2 flag2 flag3 @GROUP1 |
72 | GROUP2 flag2 flag3 @GROUP1 |
| … | |
… | |
| 76 | FOO bar baz fnord |
90 | FOO bar baz fnord |
| 77 | |
91 | |
| 78 | Users may create their own groups using ``/etc/portage/use.groups``. This |
92 | Users may create their own groups using ``/etc/portage/use.groups``. This |
| 79 | file overrides the profile settings in the case of duplicates. |
93 | file overrides the profile settings in the case of duplicates. |
| 80 | |
94 | |
|
|
95 | It should be legal for groups to specify -use flags, although for reasons |
|
|
96 | discussed below this feature should not generally be used. The syntax is |
|
|
97 | the same: |
|
|
98 | |
|
|
99 | :: |
|
|
100 | |
|
|
101 | # This group contains two negative flags |
|
|
102 | GROUP1 flag1 -flag2 -flag3 flag4 |
|
|
103 | |
|
|
104 | Groups may *not* contain circular group references. The following example |
|
|
105 | is illegal: |
|
|
106 | |
|
|
107 | :: |
|
|
108 | |
|
|
109 | # Illegal circular references |
|
|
110 | GROUP1 @GROUP2 foo |
|
|
111 | GROUP2 @GROUP1 bar |
|
|
112 | |
| 81 | Group Descriptions |
113 | Group Descriptions |
| 82 | ------------------ |
114 | ------------------ |
| 83 | |
115 | |
| 84 | Groups shall have a textual description associated with them in the same |
116 | Groups shall have a textual description associated with them in the same |
| 85 | way as USE flags. The file ``${PORTDIR}/profiles/use.groups.desc`` |
117 | way as USE flags. The file ``${PORTDIR}/profiles/use.groups.desc`` |
| … | |
… | |
| 94 | |
126 | |
| 95 | Using Groups |
127 | Using Groups |
| 96 | ------------ |
128 | ------------ |
| 97 | |
129 | |
| 98 | Groups may be used in ``/etc/make.conf``, ``/etc/portage/package.use`` and |
130 | Groups may be used in ``/etc/make.conf``, ``/etc/portage/package.use`` and |
| 99 | other places where USE flags are normally specified. Again, the @ symbol |
131 | other places where USE flags are normally specified. They may *not* be |
| 100 | is used. For example, a ``make.conf`` for a desktop system might resemble: |
132 | used inside ``IUSE`. As before, the @ symbol is used to indicate that a |
|
|
133 | group is being referenced. For example, a ``make.conf`` for a KDE desktop |
|
|
134 | system might resemble: |
| 101 | |
135 | |
| 102 | :: |
136 | :: |
| 103 | |
137 | |
| 104 | USE="@DESKTOP @KDE perl alsa dvd" |
138 | USE="@DESKTOP @KDE perl alsa dvd" |
| 105 | |
139 | |
| 106 | Additional Issues |
140 | Groups may be preceded by a -sign to invert their contents (that is, all |
| 107 | ----------------- |
141 | 'enable' use flags become -flags, and all -flags become enable flags). Be |
|
|
142 | warned that this feature can cause confusion (see below). Example usage: |
| 108 | |
143 | |
| 109 | Groups should *not* generally contain negative USE flags, as this would |
144 | :: |
| 110 | lead to confusion. Groups are intended to specify what will be enabled for |
|
|
| 111 | a given role, not what will be turned off. For example, if the @KDE group |
|
|
| 112 | disabled Gnome-related USE flags, and a user used ``USE="@GNOME @KDE"`` to |
|
|
| 113 | specify that they wanted both Gnome *and* KDE to be used where applicable, |
|
|
| 114 | chaos would ensue. However, for the sake of consistency, -flags should be |
|
|
| 115 | supported even if their use is strongly discouraged. |
|
|
| 116 | |
145 | |
| 117 | It is proposed that ``-@GROUP`` syntax should *not* be supported. Instead, |
146 | # We have the following groups defined... |
| 118 | users wishing to turn most things off could use the ``-*`` USE syntax |
147 | GROUP1 foo bar |
| 119 | along with a group (for example, @RECOMMENDED or @MINIMAL) which turned on |
148 | GROUP2 -bar baz -fnord |
| 120 | flags (for example, pam and readline) which should usually be used. |
149 | GROUP3 @GROUP1 -@GROUP2 -bar foo |
|
|
150 | GROUP4 -foo -bar |
|
|
151 | |
|
|
152 | # And the following... |
|
|
153 | USE="-@GROUP3 @GROUP4 bar" |
|
|
154 | |
|
|
155 | # which resolves to... |
|
|
156 | USE="-@GROUP1 @GROUP2 bar -foo -foo -bar bar" |
|
|
157 | USE="-foo -bar bar -baz fnord bar -foo -foo -bar bar" |
|
|
158 | USE="-baz fnord -foo bar" |
|
|
159 | |
|
|
160 | |
|
|
161 | Issues with -flags and -@GROUPS |
|
|
162 | ------------------------------- |
|
|
163 | |
|
|
164 | Earlier drafts of this GLEP did not allow -use flags or -@GROUPS. However, |
|
|
165 | because of feedback along the lines of "we shouldn't disallow features |
|
|
166 | just because some users won't understand them" (for example, [3]_), these |
|
|
167 | are now allowed but discouraged. |
|
|
168 | |
|
|
169 | The problems are best illustrated by example. Say we have the following |
|
|
170 | groups defined: |
|
|
171 | |
|
|
172 | :: |
|
|
173 | |
|
|
174 | KDE X kde qt |
|
|
175 | GNOME X gtk gtk2 gnome |
|
|
176 | |
|
|
177 | A user who wants a KDE desktop but no GNOME may do the following: |
|
|
178 | |
|
|
179 | :: |
|
|
180 | |
|
|
181 | USE="@KDE -@GNOME" |
|
|
182 | |
|
|
183 | However, this will not give the desired effect -- the ``X`` USE flag will |
|
|
184 | end up being disabled. |
|
|
185 | |
|
|
186 | Similarly, -use flags could cause a lot of confusion if misused. If, for |
|
|
187 | example, the KDE group turned off GNOME things and the GNOME group turned |
|
|
188 | off KDE things: |
|
|
189 | |
|
|
190 | :: |
|
|
191 | |
|
|
192 | KDE X kde qt -gtk -gnome |
|
|
193 | GNOME X gtk gtk2 gnome -kde -qt |
|
|
194 | |
|
|
195 | And a user wished to use both KDE and GNOME on a system, and so had USE |
|
|
196 | flags as follows: |
|
|
197 | |
|
|
198 | :: |
|
|
199 | |
|
|
200 | USE="@KDE @GNOME" |
|
|
201 | |
|
|
202 | They would end up with: |
|
|
203 | |
|
|
204 | :: |
|
|
205 | |
|
|
206 | USE="X kde qt -gtk -gnome X gtk gtk2 gnome -kde -qt" |
|
|
207 | |
|
|
208 | Which simplifies: |
|
|
209 | |
|
|
210 | :: |
|
|
211 | |
|
|
212 | USE="X gtk gtk2 gnome -kde -qt" |
|
|
213 | |
|
|
214 | This is clearly not the desired effect. |
| 121 | |
215 | |
| 122 | Adding New Groups |
216 | Adding New Groups |
| 123 | ----------------- |
217 | ----------------- |
| 124 | |
218 | |
| 125 | The actual groups to be created is beyond the scope of this GLEP, and any |
219 | The actual groups to be created is beyond the scope of this GLEP, and any |
| 126 | group names contained herein should be treated as examples only. Creation |
220 | group names contained herein should be treated as examples only. Creation |
| 127 | of new groups and changing a group's flags should be discussed on the |
221 | of new groups and changing a group's flags should be discussed on the |
| 128 | gentoo-dev mailing list as per existing policy for new global USE flags. |
222 | gentoo-dev mailing list as per existing policy for new global USE flags. |
| 129 | |
223 | |
|
|
224 | In particular, any changes involving -flags *must* be thoroughly discussed |
|
|
225 | before implementation. |
|
|
226 | |
| 130 | Rationale |
227 | Rationale |
| 131 | ========= |
228 | ========= |
| 132 | |
229 | |
| 133 | USE groups will simplify selecting an appropriate set of USE flags for a |
230 | USE groups will simplify selecting an appropriate set of USE flags for a |
| 134 | system. |
231 | system. |
| … | |
… | |
| 136 | Reference Implementation |
233 | Reference Implementation |
| 137 | ======================== |
234 | ======================== |
| 138 | |
235 | |
| 139 | TODO |
236 | TODO |
| 140 | |
237 | |
| 141 | Backwards Compatability |
238 | Backwards Compatibility |
| 142 | ======================= |
239 | ======================= |
| 143 | |
240 | |
| 144 | The user will not need to make any changes to keep their current setup. |
241 | The user will not need to make any changes to keep their current setup. |
| 145 | Users who are not running a portage version which supports groups can |
242 | Users who are not running a portage version which supports groups can |
| 146 | carry on using current syntax with no side-effects. |
243 | carry on using current syntax with no side-effects. |
| 147 | |
244 | |
| 148 | Some tools which work with make.conf and / or USE flags (for example, |
245 | Some tools which work with make.conf and / or USE flags (for example, |
| 149 | ``ufed``) will need to be updated to understand the new group syntax. |
246 | ``ufed``) will need to be updated to understand the new group syntax. |
| 150 | |
247 | |
| 151 | There is currently a dymanic list of USE flags available on the Gentoo |
248 | There is currently a dynamic list of USE flags available on the Gentoo |
| 152 | website [2]. For consistency, a similar list will be needed for USE |
249 | website [2]_. For consistency, a similar list will be needed for USE |
| 153 | groups. |
250 | groups. |
| 154 | |
251 | |
| 155 | References |
252 | References |
| 156 | ========== |
253 | ========== |
| 157 | |
254 | |
| 158 | .. [1] GLEP 23: Portage handling of ACCEPT_LICENSE |
255 | .. [1] GLEP 23: Portage handling of ACCEPT_LICENSE |
| 159 | (http://www.gentoo.org/proj/en/glep/glep-0023.html) |
256 | (http://www.gentoo.org/proj/en/glep/glep-0023.html) |
| 160 | .. [2] http://www.gentoo.org/dyn/use-index.xml |
257 | .. [2] http://www.gentoo.org/dyn/use-index.xml |
|
|
258 | .. [3] GLEP 29 discussion on the gentoo-dev mailing list |
|
|
259 | (http://marc.theaimsgroup.com/?l=gentoo-dev&m=109813990013812) |
| 161 | |
260 | |
| 162 | Copyright |
261 | Copyright |
| 163 | ========= |
262 | ========= |
| 164 | |
263 | |
| 165 | This document has been placed in the public domain. |
264 | This document has been placed in the public domain. |