| 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.6</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">2009/02/20 09:19:56</a></td>
|
| 34 |
</tr>
|
| 35 |
<tr class="field"><th class="field-name">Author:</th><td class="field-body">Tal Peer <coredumb at gentoo.org>,
|
| 36 |
Alec Warner <antarus at gentoo.org></td>
|
| 37 |
</tr>
|
| 38 |
<tr class="field"><th class="field-name">Status:</th><td class="field-body">Final</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@lists.gentoo.org">gentoo-portage-dev@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>Abandoned. Package set support has been added in portage-2.2, but it
|
| 74 |
doesn't match the description in this document in many cases, and the
|
| 75 |
document has several major gaps regarding the behavior and restrictions
|
| 76 |
of package sets.</p>
|
| 77 |
</div>
|
| 78 |
<div class="section">
|
| 79 |
<h1><a class="toc-backref" href="#id4" id="abstract" name="abstract">Abstract</a></h1>
|
| 80 |
<p>In Portage, package sets (formerly known as 'classes' or 'targets')
|
| 81 |
are mere groups of packages, grouped together to allow easier updating
|
| 82 |
and handling of them. Currently it is impossible to define sets further
|
| 83 |
than the two default ones: "system" and "world".</p>
|
| 84 |
</div>
|
| 85 |
<div class="section">
|
| 86 |
<h1><a class="toc-backref" href="#id5" id="motivation" name="motivation">Motivation</a></h1>
|
| 87 |
<p>Over the months, quite a few requests for user-defined sets were
|
| 88 |
made by users and developers, either by posting bugs, messages to
|
| 89 |
mailing lists or on IRC. Usually the response is that this is an
|
| 90 |
awesome idea, but no one ever took the time to actually define it
|
| 91 |
properly and implement it.</p>
|
| 92 |
<p>This document offers a specification for the implementation of
|
| 93 |
user-defined sets using configuration files similar to the current
|
| 94 |
world/system sets use.</p>
|
| 95 |
</div>
|
| 96 |
<div class="section">
|
| 97 |
<h1><a class="toc-backref" href="#id6" id="specification" name="specification">Specification</a></h1>
|
| 98 |
<p>The proposed implementation uses a one file per set approach, meaning
|
| 99 |
each package set is defined in a single file. All set definition files
|
| 100 |
will reside in a directory <tt class="docutils literal"><span class="pre">/etc/portage/sets/</span></tt> and each set's name
|
| 101 |
will be its file name. Therefore, if one defines a set in
|
| 102 |
/etc/portage/sets/foo-set, the set name will be 'foo-set'. Usual
|
| 103 |
package naming rules <a class="footnote-reference" href="#name-rules" id="id1" name="id1">[1]</a> also apply to sets.</p>
|
| 104 |
<p>As it is impossible to create two or more files with identical names
|
| 105 |
in the same directory, a theoretic conflict between two different sets
|
| 106 |
sharing the same name is impossible. However, users may define a
|
| 107 |
package set whose name conflicts with one more or packages (for ambiguity
|
| 108 |
resolution, see below).</p>
|
| 109 |
<p>Syntax for the package list file is the same as the world file syntax,
|
| 110 |
as described in the Portage manpage <a class="footnote-reference" href="#portage-manpage" id="id2" name="id2">[2]</a>, with one
|
| 111 |
addition: sets may not be 'inherited' by other sets, only packages may
|
| 112 |
be listed. There is no limitation to the number of packages in a set
|
| 113 |
or to the number of sets a package may belong to.</p>
|
| 114 |
<div class="section">
|
| 115 |
<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>
|
| 116 |
<p>The user-defined sets will be available either directly or using
|
| 117 |
the --package-set option, As in:</p>
|
| 118 |
<pre class="literal-block">
|
| 119 |
# Basically the same:
|
| 120 |
emerge foo-set
|
| 121 |
emerge --package-set foo-set
|
| 122 |
</pre>
|
| 123 |
<p>The --package-set option is introduced to bypass ambiguities, as
|
| 124 |
illustrated in the next example:</p>
|
| 125 |
<pre class="literal-block">
|
| 126 |
emerge foo # Where foo is both a set and a one or more
|
| 127 |
# existing packages. This will cause emerge to show
|
| 128 |
# the ambiguity, ask us to be more
|
| 129 |
# specific, and stop.
|
| 130 |
|
| 131 |
emerge --package-set foo # So we specify that what we actually
|
| 132 |
# meant was the package set.
|
| 133 |
|
| 134 |
emerge cat-bar/foo # Or we specify the exact package name.
|
| 135 |
</pre>
|
| 136 |
<p>When running emerge with the --pretend option, sets will be
|
| 137 |
expanded to the packages they are comprised off in the output, as with
|
| 138 |
the current system-defined sets.</p>
|
| 139 |
<p>Only one set may be passed to portage at time, and sets can not
|
| 140 |
be mixed with ordinary packages. Thus, the following snippets are
|
| 141 |
all invalid and will result in an error (assuming <tt class="docutils literal"><span class="pre">foo-set</span></tt> and
|
| 142 |
<tt class="docutils literal"><span class="pre">bar-set</span></tt> are defined as sets):</p>
|
| 143 |
<pre class="literal-block">
|
| 144 |
emerge foo-set glibc
|
| 145 |
emerge bar-set system
|
| 146 |
emerge world foo-set gcc
|
| 147 |
</pre>
|
| 148 |
</div>
|
| 149 |
<div class="section">
|
| 150 |
<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>
|
| 151 |
<ul class="simple">
|
| 152 |
<li>Dependencies:
|
| 153 |
Package sets (both system-defined and user-defined) may not be
|
| 154 |
depended on by ordinary packages and eclasses.</li>
|
| 155 |
<li>package.mask:
|
| 156 |
Masking a package set through the <tt class="docutils literal"><span class="pre">package.mask</span></tt> file is forbidden.
|
| 157 |
In order to 'mask' a package set, one should move it away from the
|
| 158 |
sets directory.</li>
|
| 159 |
<li>package.use:
|
| 160 |
USE flags may not be defined for sets in the <tt class="docutils literal"><span class="pre">package.use</span></tt> file.</li>
|
| 161 |
</ul>
|
| 162 |
</div>
|
| 163 |
</div>
|
| 164 |
<div class="section">
|
| 165 |
<h1><a class="toc-backref" href="#id9" id="implementation" name="implementation">Implementation</a></h1>
|
| 166 |
<p>The implementation of the package sets concept in Portage should be
|
| 167 |
mostly done in portage.py, and only the interface parts should be
|
| 168 |
added to emerge itself, to keep the separation between interface and
|
| 169 |
logic.</p>
|
| 170 |
<p>The amount of work needed for implementation is not trivial, but not
|
| 171 |
huge either.</p>
|
| 172 |
</div>
|
| 173 |
<div class="section">
|
| 174 |
<h1><a class="toc-backref" href="#id10" id="rationale" name="rationale">Rationale</a></h1>
|
| 175 |
<p>The one file per set approach makes it easy to list the sets which are
|
| 176 |
defined on a system by just listing the <tt class="docutils literal"><span class="pre">/etc/portage/sets</span></tt>
|
| 177 |
directory contents. Additionally, it makes the set lookup process more
|
| 178 |
efficient as it only requires to check if a file exists.</p>
|
| 179 |
<p>I chose the --package-set option over the --set option for explicitly
|
| 180 |
telling portage to emerge a set mostly because --set implies setting
|
| 181 |
an environment variable, or such.</p>
|
| 182 |
<p>Allowing sets' USE flags to be manipulated through the <tt class="docutils literal"><span class="pre">package.use</span></tt>
|
| 183 |
file would have done more harm than good, for several reasons:</p>
|
| 184 |
<ul class="simple">
|
| 185 |
<li>If a USE flag is turned on (i.e. 'foo') for a set and the same USE
|
| 186 |
flag is turned off (i.e. '-foo'), for a package which is part of
|
| 187 |
the set, it is unclear which setting should take precedence.</li>
|
| 188 |
<li>Similarly, if a USE flag is turned on for a set and the same USE flag
|
| 189 |
is turned off for a set that is a subset of the original set, it is
|
| 190 |
unclear which setting should take precedence.</li>
|
| 191 |
<li>If a USE flag is defined (either off or on) for a set and a package
|
| 192 |
that belongs in the set is to be emerged, it is unclear whether the
|
| 193 |
USE flag should be defined when emerging the package in question.</li>
|
| 194 |
</ul>
|
| 195 |
<p>Therefore, I have decided it would be better to disallow setting USE
|
| 196 |
flags for sets.</p>
|
| 197 |
</div>
|
| 198 |
<div class="section">
|
| 199 |
<h1><a class="toc-backref" href="#id11" id="backwards-compatibility" name="backwards-compatibility">Backwards Compatibility</a></h1>
|
| 200 |
<p>Backwards compatibility with the current situation, in which only two
|
| 201 |
system-defined sets exist can be kept in one of two ways:</p>
|
| 202 |
<ol class="arabic simple">
|
| 203 |
<li>Leaving the situation as is - the 'world' and 'system' sets are
|
| 204 |
hard-coded in Portage.</li>
|
| 205 |
<li>Distributing default 'system' and 'world' files under the
|
| 206 |
<tt class="docutils literal"><span class="pre">/etc/portage/sets/</span></tt> directory.</li>
|
| 207 |
</ol>
|
| 208 |
<p>Other than that, there are no other backwards compatibility concerns
|
| 209 |
involved.</p>
|
| 210 |
</div>
|
| 211 |
<div class="section">
|
| 212 |
<h1><a class="toc-backref" href="#id12" id="references" name="references">References</a></h1>
|
| 213 |
<table class="docutils footnote" frame="void" id="name-rules" rules="none">
|
| 214 |
<colgroup><col class="label" /><col /></colgroup>
|
| 215 |
<tbody valign="top">
|
| 216 |
<tr><td class="label"><a class="fn-backref" href="#id1" name="name-rules">[1]</a></td><td>Gentoo Linux Development Policy - Ebuild Policy
|
| 217 |
(<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>
|
| 218 |
</tbody>
|
| 219 |
</table>
|
| 220 |
<table class="docutils footnote" frame="void" id="portage-manpage" rules="none">
|
| 221 |
<colgroup><col class="label" /><col /></colgroup>
|
| 222 |
<tbody valign="top">
|
| 223 |
<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>
|
| 224 |
</tbody>
|
| 225 |
</table>
|
| 226 |
</div>
|
| 227 |
<div class="section">
|
| 228 |
<h1><a class="toc-backref" href="#id13" id="copyright" name="copyright">Copyright</a></h1>
|
| 229 |
<p>This document has been placed in the public domain.</p>
|
| 230 |
</div>
|
| 231 |
|
| 232 |
</div>
|
| 233 |
<div class="footer">
|
| 234 |
<hr class="footer" />
|
| 235 |
<a class="reference" href="glep-0021.txt">View document source</a>.
|
| 236 |
Generated on: 2009-02-20 09:21 UTC.
|
| 237 |
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.
|
| 238 |
|
| 239 |
</div>
|
| 240 |
</body>
|
| 241 |
</html>
|
| 242 |
|