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