/[gentoo]/xml/htdocs/doc/en/handbook/hb-working-use.xml
Gentoo

Diff of /xml/htdocs/doc/en/handbook/hb-working-use.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 Revision 1.17
1<?xml version='1.0' encoding='UTF-8'?>
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
1<!-- The content of this document is licensed under the CC-BY-SA license --> 4<!-- The content of this document is licensed under the CC-BY-SA license -->
2<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
3 6
4<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.5 2003/12/16 18:08:56 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.17 2004/08/01 13:08:35 swift Exp $ -->
5 8
6<sections> 9<sections>
7<section> 10<section>
8<title>What are USE-flags?</title> 11<title>What are USE-flags?</title>
9<subsection> 12<subsection>
25with KDE-support if those packages work flawlessly without? 28with KDE-support if those packages work flawlessly without?
26</p> 29</p>
27 30
28<p> 31<p>
29To help users in deciding what to install/activate and what not, we wanted the 32To help users in deciding what to install/activate and what not, we wanted the
30user to specify his environment in an easy way. This forces the user into 33user to specify his/her environment in an easy way. This forces the user into
31deciding what he really wants and eases the process for Portage, our package 34deciding what they really want and eases the process for Portage, our package
32managment system, to make useful decisions. 35managment system, to make useful decisions.
33</p> 36</p>
34 37
35</body> 38</body>
36</subsection> 39</subsection>
44Portage will know that you want support for the chosen keyword. Of course 47Portage will know that you want support for the chosen keyword. Of course
45this also alters the dependency information for a package. 48this also alters the dependency information for a package.
46</p> 49</p>
47 50
48<p> 51<p>
49Lets take a look at a specific example: the <c>kde</c> keyword. If you do not 52Let us take a look at a specific example: the <c>kde</c> keyword. If you do not
50have this keyword in your <c>USE</c> variable, all packages that have 53have this keyword in your <c>USE</c> variable, all packages that have
51<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All 54<e>optional</e> KDE support will be compiled <e>without</e> KDE support. All
52packages that have an <e>optional</e> KDE dependency will be installed 55packages that have an <e>optional</e> KDE dependency will be installed
53<e>without</e> installing the KDE libraries (as dependency). If you have defined 56<e>without</e> installing the KDE libraries (as dependency). If you have defined
54the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE 57the <c>kde</c> keyword, then those packages <e>will</e> be compiled with KDE
74 <li> 77 <li>
75 A <e>global</e> USE-flag is used by several packages, system-wide. This is 78 A <e>global</e> USE-flag is used by several packages, system-wide. This is
76 what most people see as USE-flags. 79 what most people see as USE-flags.
77 </li> 80 </li>
78 <li> 81 <li>
79 A <e>local</e> USE-fag is used by a single package to make package-specific 82 A <e>local</e> USE-flag is used by a single package to make package-specific
80 decisions. 83 decisions.
81 </li> 84 </li>
82</ul> 85</ul>
83 86
84<p> 87<p>
119we think are commonly used by the Gentoo users. This default setting is declared 122we think are commonly used by the Gentoo users. This default setting is declared
120in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at 123in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at
121this default setting: 124this default setting:
122</p> 125</p>
123 126
124<pre caption="/etc/make.profile/make.defaults USE variable"> 127<pre caption="/etc/make.profile/make.defaults USE variable on an x86 system">
125USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk 128USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm
126 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls 129 gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses
127 oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang 130 nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl
128 spell ssl svga tcpd truetype X xml2 xmms xv zlib" 131 slang spell ssl svga tcpd truetype X xml2 xmms xv zlib"
129</pre> 132</pre>
130 133
131<p> 134<p>
132As you can see, this variable already contains quite a lot of keywords. Do 135As you can see, this variable already contains quite a lot of keywords. Do
133<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor 136<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor
150 153
151<pre caption="An example USE setting in /etc/make.conf"> 154<pre caption="An example USE setting in /etc/make.conf">
152USE="-kde -qt ldap" 155USE="-kde -qt ldap"
153</pre> 156</pre>
154 157
158<p>
159Sometimes you want to declare a certain USE flag for one (or a couple) of
160applications but not system-wide. To accomplish this, you will need to create
161the <path>/etc/portage</path> directory (if it doesn't exist yet) and edit
162<path>/etc/portage/package.use</path>.
163</p>
164
165<p>
166For instance, if you don't want <c>berkdb</c> support globally but you do want
167it for <c>mysql</c>, you would add:
168</p>
169
170<pre caption="/etc/portage/package.use example">
171dev-db/mysql berkdb
172</pre>
173
174<p>
175You can of course also explicitly <e>disable</e> USE flags for a certain
176application. For instance, if you don't want <c>java</c> support in PHP:
177</p>
178
179<pre caption="/etc/portage/package.use 2nd example">
180dev-php/php -java
181</pre>
182
155</body> 183</body>
156</subsection> 184</subsection>
157<subsection> 185<subsection>
158<title>Declare temporary USE-flags</title> 186<title>Declare temporary USE-flags</title>
159<body> 187<body>
160 188
161<p> 189<p>
162Sometimes you want to set a certain USE-setting only once. Instead of editing 190Sometimes you want to set a certain USE-setting only once. Instead of editing
163<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just 191<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just
164declare the USE-variable as environment variable. 192declare the USE-variable as environment variable. Remember that, when you
193re-emerge or update this application (either explicitly or as part of a system
194update) your changes will be lost!
165</p> 195</p>
166 196
167<p> 197<p>
168As an example we will temporarily remove java from the USE-setting 198As an example we will temporarily remove java from the USE-setting
169during the installation of mozilla. 199during the installation of mozilla.
172<note> 202<note>
173The <c>emerge</c> command will be discussed more thoroughly in <uri 203The <c>emerge</c> command will be discussed more thoroughly in <uri
174link="?part=2&amp;chap=2">Portage and Software</uri>. 204link="?part=2&amp;chap=2">Portage and Software</uri>.
175</note> 205</note>
176 206
177<pre caption="Using USE as evironment variable"> 207<pre caption="Using USE as environment variable">
178# <i>USE="-java" emerge mozilla</i> 208# <i>USE="-java" emerge mozilla</i>
179</pre> 209</pre>
180 210
181</body> 211</body>
182</subsection> 212</subsection>
200</pre> 230</pre>
201 231
202</body> 232</body>
203</subsection> 233</subsection>
204<subsection> 234<subsection>
205<title>Precendence</title> 235<title>Precedence</title>
206<body> 236<body>
207 237
208<p> 238<p>
209Of course there is a certain precendence on what setting has priority over the 239Of course there is a certain precedence on what setting has priority over the
210USE setting. You don't want to declare <c>USE="-java"</c> only to see that 240USE setting. You don't want to declare <c>USE="-java"</c> only to see that
211<c>java</c> is declared anyway. The precedence for the USE setting is, ordered 241<c>java</c> is declared anyway. The precedence for the USE setting is, ordered
212by priority (first has lowest priority): 242by priority (first has lowest priority):
213</p> 243</p>
214 244
222 </li> 252 </li>
223 <li> 253 <li>
224 User-defined USE setting in <path>/etc/make.conf</path> 254 User-defined USE setting in <path>/etc/make.conf</path>
225 </li> 255 </li>
226 <li> 256 <li>
257 User-defined USE setting in <path>/etc/portage/package.use</path>
258 </li>
259 <li>
227 User-defined USE setting as environment variable 260 User-defined USE setting as environment variable
228 </li> 261 </li>
229</ol> 262</ol>
230 263
231<p> 264<p>
235</p> 268</p>
236 269
237<pre caption="Running emerge info"> 270<pre caption="Running emerge info">
238# <i>emerge info</i> 271# <i>emerge info</i>
239</pre> 272</pre>
273
274</body>
275</subsection>
276<subsection>
277<title>Adapting your Entire System to New USE Flags</title>
278<body>
279
280<p>
281If you have altered your USE flags and you wish to update your entire system to
282use the new USE flags, you can try following the next steps to accomplish this.
283Note however that these steps will take a long time to finish and that work is
284on the way to adjust Portage to handle this behaviour quicker and automatically.
285</p>
286
287<p>
288First of all, rebuild your entire system using the new USE flags:
289</p>
290
291<pre caption="Rebuilding your entire system">
292# <i>emerge --emptytree world</i>
293</pre>
294
295<p>
296Next, run Portage' depclean to remove the conditional dependencies that
297were emerged on your "old" system but that have been obsoleted by the new USE
298flags.
299</p>
300
301<warn>
302Running <c>emerge depclean</c> is a dangerous operation and should be handled
303with care. Double-check the provided list of "obsoleted" packages to make sure
304it doesn't remove packages you need. In the following example we add the
305<c>-p</c> switch to have depclean only list the packages without removing them.
306</warn>
307
308<pre caption="Removing obsoleted packages">
309# <i>emerge -p depclean</i>
310</pre>
311
312<p>
313When depclean has finished, your system is using the new USE flag settings.
314</p>
240 315
241</body> 316</body>
242</subsection> 317</subsection>
243</section> 318</section>
244<section> 319<section>

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20