/[gentoo]/xml/htdocs/proj/en/glep/glep-0021.html
Gentoo

Contents of /xml/htdocs/proj/en/glep/glep-0021.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download) (as text)
Sun Oct 14 17:00:15 2007 UTC (6 years, 10 months ago) by antarus
Branch: MAIN
Changes since 1.6: +6 -253 lines
File MIME type: text/html
the canary on 53 went well, changing the rest

1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
8 <title>GLEP 21 -- User-defined Package Sets</title>
9 <link rel="stylesheet" href="tools/glep.css" type="text/css" />
10 </head>
11 <body bgcolor="white">
12 <table class="navigation" cellpadding="0" cellspacing="0"
13 width="100%" border="0">
14 <tr><td class="navicon" width="150" height="35">
15 <a href="http://www.gentoo.org/" title="Gentoo Linux Home Page">
16 <img src="http://www.gentoo.org/images/gentoo-new.gif" alt="[Gentoo]"
17 border="0" width="150" height="35" /></a></td>
18 <td class="textlinks" align="left">
19 [<b><a href="http://www.gentoo.org/">Gentoo Linux Home</a></b>]
20 [<b><a href="http://www.gentoo.org/proj/en/glep">GLEP Index</a></b>]
21 [<b><a href="http://www.gentoo.org/proj/en/glep/glep-0021.txt">GLEP Source</a></b>]
22 </td></tr></table>
23 <table class="rfc2822 docutils field-list" frame="void" rules="none">
24 <col class="field-name" />
25 <col class="field-body" />
26 <tbody valign="top">
27 <tr class="field"><th class="field-name">GLEP:</th><td class="field-body">21</td>
28 </tr>
29 <tr class="field"><th class="field-name">Title:</th><td class="field-body">User-defined Package Sets</td>
30 </tr>
31 <tr class="field"><th class="field-name">Version:</th><td class="field-body">1.4</td>
32 </tr>
33 <tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/proj/en/glep/glep-0021.txt?cvsroot=gentoo">2007/04/21 03:13:16</a></td>
34 </tr>
35 <tr class="field"><th class="field-name">Author:</th><td class="field-body">Tal Peer &lt;coredumb&#32;&#97;t&#32;gentoo.org&gt;,
36 Alec Warner &lt;antarus&#32;&#97;t&#32;gentoo.org&gt;</td>
37 </tr>
38 <tr class="field"><th class="field-name">Status:</th><td class="field-body">Deferred</td>
39 </tr>
40 <tr class="field"><th class="field-name">Type:</th><td class="field-body">Standards Track</td>
41 </tr>
42 <tr class="field"><th class="field-name">Discussed-To:</th><td class="field-body"><a class="reference" href="mailto:gentoo-portage-dev&#64;lists.gentoo.org">gentoo-portage-dev&#64;lists.gentoo.org</a></td>
43 </tr>
44 <tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference" href="glep-0002.html">text/x-rst</a></td>
45 </tr>
46 <tr class="field"><th class="field-name">Created:</th><td class="field-body">22-Feb-2004</td>
47 </tr>
48 <tr class="field"><th class="field-name">Post-History:</th><td class="field-body">6-Mar-2004, 3-Sep-2006</td>
49 </tr>
50 </tbody>
51 </table>
52 <hr />
53 <div class="contents topic">
54 <p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
55 <ul class="simple">
56 <li><a class="reference" href="#status" id="id3" name="id3">Status</a></li>
57 <li><a class="reference" href="#abstract" id="id4" name="id4">Abstract</a></li>
58 <li><a class="reference" href="#motivation" id="id5" name="id5">Motivation</a></li>
59 <li><a class="reference" href="#specification" id="id6" name="id6">Specification</a><ul>
60 <li><a class="reference" href="#using-user-defined-sets-with-emerge" id="id7" name="id7">Using User-defined Sets With Emerge</a></li>
61 <li><a class="reference" href="#compatibility-with-other-portage-features" id="id8" name="id8">Compatibility With Other Portage Features</a></li>
62 </ul>
63 </li>
64 <li><a class="reference" href="#implementation" id="id9" name="id9">Implementation</a></li>
65 <li><a class="reference" href="#rationale" id="id10" name="id10">Rationale</a></li>
66 <li><a class="reference" href="#backwards-compatibility" id="id11" name="id11">Backwards Compatibility</a></li>
67 <li><a class="reference" href="#references" id="id12" name="id12">References</a></li>
68 <li><a class="reference" href="#copyright" id="id13" name="id13">Copyright</a></li>
69 </ul>
70 </div>
71 <div class="section">
72 <h1><a class="toc-backref" href="#id3" id="status" name="status">Status</a></h1>
73 <p>Taken over by antarus.</p>
74 </div>
75 <div class="section">
76 <h1><a class="toc-backref" href="#id4" id="abstract" name="abstract">Abstract</a></h1>
77 <p>In Portage, package sets (formerly known as 'classes' or 'targets')
78 are mere groups of packages, grouped together to allow easier updating
79 and handling of them. Currently it is impossible to define sets further
80 than the two default ones: &quot;system&quot; and &quot;world&quot;.</p>
81 </div>
82 <div class="section">
83 <h1><a class="toc-backref" href="#id5" id="motivation" name="motivation">Motivation</a></h1>
84 <p>Over the months, quite a few requests for user-defined sets were
85 made by users and developers, either by posting bugs, messages to
86 mailing lists or on IRC. Usually the response is that this is an
87 awesome idea, but no one ever took the time to actually define it
88 properly and implement it.</p>
89 <p>This document offers a specification for the implementation of
90 user-defined sets using configuration files similar to the current
91 world/system sets use.</p>
92 </div>
93 <div class="section">
94 <h1><a class="toc-backref" href="#id6" id="specification" name="specification">Specification</a></h1>
95 <p>The proposed implementation uses a one file per set approach, meaning
96 each package set is defined in a single file. All set definition files
97 will reside in a directory <tt class="docutils literal"><span class="pre">/etc/portage/sets/</span></tt> and each set's name
98 will be its file name. Therefore, if one defines a set in
99 /etc/portage/sets/foo-set, the set name will be 'foo-set'. Usual
100 package naming rules <a class="footnote-reference" href="#name-rules" id="id1" name="id1">[1]</a> also apply to sets.</p>
101 <p>As it is impossible to create two or more files with identical names
102 in the same directory, a theoretic conflict between two different sets
103 sharing the same name is impossible. However, users may define a
104 package set whose name conflicts with one more or packages (for ambiguity
105 resolution, see below).</p>
106 <p>Syntax for the package list file is the same as the world file syntax,
107 as described in the Portage manpage <a class="footnote-reference" href="#portage-manpage" id="id2" name="id2">[2]</a>, with one
108 addition: sets may not be 'inherited' by other sets, only packages may
109 be listed. There is no limitation to the number of packages in a set
110 or to the number of sets a package may belong to.</p>
111 <div class="section">
112 <h2><a class="toc-backref" href="#id7" id="using-user-defined-sets-with-emerge" name="using-user-defined-sets-with-emerge">Using User-defined Sets With Emerge</a></h2>
113 <p>The user-defined sets will be available either directly or using
114 the --package-set option, As in:</p>
115 <pre class="literal-block">
116 # Basically the same:
117 emerge foo-set
118 emerge --package-set foo-set
119 </pre>
120 <p>The --package-set option is introduced to bypass ambiguities, as
121 illustrated in the next example:</p>
122 <pre class="literal-block">
123 emerge foo # Where foo is both a set and a one or more
124 # existing packages. This will cause emerge to show
125 # the ambiguity, ask us to be more
126 # specific, and stop.
127
128 emerge --package-set foo # So we specify that what we actually
129 # meant was the package set.
130
131 emerge cat-bar/foo # Or we specify the exact package name.
132 </pre>
133 <p>When running emerge with the --pretend option, sets will be
134 expanded to the packages they are comprised off in the output, as with
135 the current system-defined sets.</p>
136 <p>Only one set may be passed to portage at time, and sets can not
137 be mixed with ordinary packages. Thus, the following snippets are
138 all invalid and will result in an error (assuming <tt class="docutils literal"><span class="pre">foo-set</span></tt> and
139 <tt class="docutils literal"><span class="pre">bar-set</span></tt> are defined as sets):</p>
140 <pre class="literal-block">
141 emerge foo-set glibc
142 emerge bar-set system
143 emerge world foo-set gcc
144 </pre>
145 </div>
146 <div class="section">
147 <h2><a class="toc-backref" href="#id8" id="compatibility-with-other-portage-features" name="compatibility-with-other-portage-features">Compatibility With Other Portage Features</a></h2>
148 <ul class="simple">
149 <li>Dependencies:
150 Package sets (both system-defined and user-defined) may not be
151 depended on by ordinary packages and eclasses.</li>
152 <li>package.mask:
153 Masking a package set through the <tt class="docutils literal"><span class="pre">package.mask</span></tt> file is forbidden.
154 In order to 'mask' a package set, one should move it away from the
155 sets directory.</li>
156 <li>package.use:
157 USE flags may not be defined for sets in the <tt class="docutils literal"><span class="pre">package.use</span></tt> file.</li>
158 </ul>
159 </div>
160 </div>
161 <div class="section">
162 <h1><a class="toc-backref" href="#id9" id="implementation" name="implementation">Implementation</a></h1>
163 <p>The implementation of the package sets concept in Portage should be
164 mostly done in portage.py, and only the interface parts should be
165 added to emerge itself, to keep the separation between interface and
166 logic.</p>
167 <p>The amount of work needed for implementation is not trivial, but not
168 huge either.</p>
169 </div>
170 <div class="section">
171 <h1><a class="toc-backref" href="#id10" id="rationale" name="rationale">Rationale</a></h1>
172 <p>The one file per set approach makes it easy to list the sets which are
173 defined on a system by just listing the <tt class="docutils literal"><span class="pre">/etc/portage/sets</span></tt>
174 directory contents. Additionally, it makes the set lookup process more
175 efficient as it only requires to check if a file exists.</p>
176 <p>I chose the --package-set option over the --set option for explicitly
177 telling portage to emerge a set mostly because --set implies setting
178 an environment variable, or such.</p>
179 <p>Allowing sets' USE flags to be manipulated through the <tt class="docutils literal"><span class="pre">package.use</span></tt>
180 file would have done more harm than good, for several reasons:</p>
181 <ul class="simple">
182 <li>If a USE flag is turned on (i.e. 'foo') for a set and the same USE
183 flag is turned off (i.e. '-foo'), for a package which is part of
184 the set, it is unclear which setting should take precedence.</li>
185 <li>Similarly, if a USE flag is turned on for a set and the same USE flag
186 is turned off for a set that is a subset of the original set, it is
187 unclear which setting should take precedence.</li>
188 <li>If a USE flag is defined (either off or on) for a set and a package
189 that belongs in the set is to be emerged, it is unclear whether the
190 USE flag should be defined when emerging the package in question.</li>
191 </ul>
192 <p>Therefore, I have decided it would be better to disallow setting USE
193 flags for sets.</p>
194 </div>
195 <div class="section">
196 <h1><a class="toc-backref" href="#id11" id="backwards-compatibility" name="backwards-compatibility">Backwards Compatibility</a></h1>
197 <p>Backwards compatibility with the current situation, in which only two
198 system-defined sets exist can be kept in one of two ways:</p>
199 <ol class="arabic simple">
200 <li>Leaving the situation as is - the 'world' and 'system' sets are
201 hard-coded in Portage.</li>
202 <li>Distributing default 'system' and 'world' files under the
203 <tt class="docutils literal"><span class="pre">/etc/portage/sets/</span></tt> directory.</li>
204 </ol>
205 <p>Other than that, there are no other backwards compatibility concerns
206 involved.</p>
207 </div>
208 <div class="section">
209 <h1><a class="toc-backref" href="#id12" id="references" name="references">References</a></h1>
210 <table class="docutils footnote" frame="void" id="name-rules" rules="none">
211 <colgroup><col class="label" /><col /></colgroup>
212 <tbody valign="top">
213 <tr><td class="label"><a class="fn-backref" href="#id1" name="name-rules">[1]</a></td><td>Gentoo Linux Development Policy - Ebuild Policy
214 (<a class="reference" href="http://www.gentoo.org/doc/en/policy.xml#doc_chap3">http://www.gentoo.org/doc/en/policy.xml#doc_chap3</a>)</td></tr>
215 </tbody>
216 </table>
217 <table class="docutils footnote" frame="void" id="portage-manpage" rules="none">
218 <colgroup><col class="label" /><col /></colgroup>
219 <tbody valign="top">
220 <tr><td class="label"><a class="fn-backref" href="#id2" name="portage-manpage">[2]</a></td><td><a class="reference" href="http://www.gentoo.org/cgi-bin/viewcvs.cgi/portage/man/portage.5?root=gentoo-src">http://www.gentoo.org/cgi-bin/viewcvs.cgi/portage/man/portage.5?root=gentoo-src</a></td></tr>
221 </tbody>
222 </table>
223 </div>
224 <div class="section">
225 <h1><a class="toc-backref" href="#id13" id="copyright" name="copyright">Copyright</a></h1>
226 <p>This document has been placed in the public domain.</p>
227 </div>
228
229 </div>
230 <div class="footer">
231 <hr class="footer" />
232 <a class="reference" href="glep-0021.txt">View document source</a>.
233 Generated on: 2007-10-13 13:39 UTC.
234 Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
235
236 </div>
237 </body>
238 </html>

  ViewVC Help
Powered by ViewVC 1.1.20