/[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.20 Revision 1.28
2<!DOCTYPE sections SYSTEM "/dtd/book.dtd"> 2<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3 3
4<!-- 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 -->
5<!-- See http://creativecommons.org/licenses/by-sa/1.0 --> 5<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->
6 6
7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.20 2004/10/10 11:09:27 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-working-use.xml,v 1.28 2005/01/23 08:47:30 swift Exp $ -->
8 8
9<sections> 9<sections>
10
11<version>1.25</version>
12<date>2005-01-23</date>
13
10<section> 14<section>
11<title>What are USE-flags?</title> 15<title>What are USE-flags?</title>
12<subsection> 16<subsection>
13<title>The ideas behind USE-flags</title> 17<title>The ideas behind USE-flags</title>
14<body> 18<body>
123<p> 127<p>
124As previously mentioned, all USE-flags are declared inside the <c>USE</c> 128As previously mentioned, all USE-flags are declared inside the <c>USE</c>
125variable. To make it easy for users to search and pick USE-flags, we already 129variable. To make it easy for users to search and pick USE-flags, we already
126provide a <e>default</e> USE setting. This setting is a collection of USE-flags 130provide a <e>default</e> USE setting. This setting is a collection of USE-flags
127we think are commonly used by the Gentoo users. This default setting is declared 131we think are commonly used by the Gentoo users. This default setting is declared
128in the <path>/etc/make.profile/make.defaults</path> file. Let us take a look at 132in the <path>make.defaults</path> files part of your profile.
129this default setting: 133</p>
134
130</p> 135<p>
136The profile your system listens to is pointed to by the
137<path>/etc/make.profile</path> symlink. Each profile works on top of another,
138larger profile, the end result is therefore the sum of all profiles. The top
139profile is the <path>base</path> profile
140(<path>/usr/portage/profiles/base</path>).
141</p>
131 142
132<pre caption="/etc/make.profile/make.defaults USE variable on an x86 system"> 143<p>
133USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm 144Let us take a look at this default setting:
134 gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses 145</p>
135 nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl 146
147<pre caption="Cumulated /usr/portage/profiles/default-linux/x86/2004.3/make.defaults USE variable">
148<comment>(This example is the sum of the settings in base, default-linux,
149 default-linux/x86 and default-linux/x86/2004.3)</comment>
150USE="x86 oss apm arts avi berkdb bitmap-fonts crypt cups encode fortran f77
151 foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg kde gnome libg++ libwww mad
152 mikmod motif mpeg ncurses nls oggvorbis opengl pam pdflib png python qt
136 slang spell ssl svga tcpd truetype X xml2 xmms xv zlib" 153 quicktime readline sdl spell ssl svga tcpd truetype X xml2 xmms xv zlib"
137</pre> 154</pre>
138 155
139<p> 156<p>
140As you can see, this variable already contains quite a lot of keywords. Do 157As you can see, this variable already contains quite a lot of keywords. Do
141<b>not</b> alter the <path>/etc/make.profile/make.defaults</path> file to tailor 158<b>not</b> alter any <path>make.defaults</path> file to tailor
142the <c>USE</c> variable to your needs: changes in this file will be undone when 159the <c>USE</c> variable to your needs: changes in this file will be undone when
143you update Portage! 160you update Portage!
144</p> 161</p>
145 162
146<p> 163<p>
207 224
208<p> 225<p>
209As an example we will temporarily remove java from the USE-setting 226As an example we will temporarily remove java from the USE-setting
210during the installation of mozilla. 227during the installation of mozilla.
211</p> 228</p>
212
213<note>
214The <c>emerge</c> command will be discussed more thoroughly in <uri
215link="?part=2&amp;chap=2">Portage and Software</uri>.
216</note>
217 229
218<pre caption="Using USE as environment variable"> 230<pre caption="Using USE as environment variable">
219# <i>USE="-java" emerge mozilla</i> 231# <i>USE="-java" emerge mozilla</i>
220</pre> 232</pre>
221 233
253by priority (first has lowest priority): 265by priority (first has lowest priority):
254</p> 266</p>
255 267
256<ol> 268<ol>
257 <li> 269 <li>
258 Default USE setting declared in <path>/etc/make.profile/make.defaults</path> 270 Default USE setting declared in the <path>make.defaults</path> files part of
271 your profile
259 </li> 272 </li>
260 <li> 273 <li>
261 Inherited USE setting if a package from 274 Inherited USE setting if a package from
262 <path>/etc/make.profile/use.defaults</path> is installed 275 <path>/etc/make.profile/use.defaults</path> is installed
263 </li> 276 </li>
271 User-defined USE setting as environment variable 284 User-defined USE setting as environment variable
272 </li> 285 </li>
273</ol> 286</ol>
274 287
275<p> 288<p>
276To view the final <c>USE</c> setting as seen by Portage, run <c>emerge info</c>. 289To view the final <c>USE</c> setting as seen by Portage, run <c>emerge
277This will list all relevant variables (including the <c>USE</c> variable) with 290--info</c>. This will list all relevant variables (including the <c>USE</c>
278the content used by Portage. 291variable) with the content used by Portage.
279</p> 292</p>
280 293
281<pre caption="Running emerge info"> 294<pre caption="Running emerge --info">
282# <i>emerge info</i> 295# <i>emerge --info</i>
283</pre> 296</pre>
284 297
285</body> 298</body>
286</subsection> 299</subsection>
287<subsection> 300<subsection>
288<title>Adapting your Entire System to New USE Flags</title> 301<title>Adapting your Entire System to New USE Flags</title>
289<body> 302<body>
290 303
291<p> 304<p>
292If you have altered your USE flags and you wish to update your entire system to 305If you have altered your USE flags and you wish to update your entire system to
293use the new USE flags, you can try following the next steps to accomplish this. 306use the new USE flags, use <c>emerge</c>'s <c>--newuse</c> option:
294Note however that these steps will take a long time to finish and that work is
295on the way to adjust Portage to handle this behaviour quicker and automatically.
296</p>
297
298<p>
299First of all, rebuild your entire system using the new USE flags:
300</p> 307</p>
301 308
302<pre caption="Rebuilding your entire system"> 309<pre caption="Rebuilding your entire system">
303# <i>emerge --emptytree world</i> 310# <i>emerge --update --deep --newuse world</i>
304</pre> 311</pre>
305 312
306<p> 313<p>
307Next, run Portage's depclean to remove the conditional dependencies that 314Next, run Portage's depclean to remove the conditional dependencies that
308were emerged on your "old" system but that have been obsoleted by the new USE 315were emerged on your "old" system but that have been obsoleted by the new USE
309flags. 316flags.
310</p> 317</p>
311 318
312<warn> 319<warn>
313Running <c>emerge depclean</c> is a dangerous operation and should be handled 320Running <c>emerge --depclean</c> is a dangerous operation and should be handled
314with care. Double-check the provided list of "obsoleted" packages to make sure 321with care. Double-check the provided list of "obsoleted" packages to make sure
315it doesn't remove packages you need. In the following example we add the 322it doesn't remove packages you need. In the following example we add the
316<c>-p</c> switch to have depclean only list the packages without removing them. 323<c>-p</c> switch to have depclean only list the packages without removing them.
317</warn> 324</warn>
318 325
319<pre caption="Removing obsoleted packages"> 326<pre caption="Removing obsoleted packages">
320# <i>emerge -p depclean</i> 327# <i>emerge -p --depclean</i>
321</pre> 328</pre>
322 329
330<p>
331When depclean has finished, run <c>revdep-rebuild</c> to rebuild the
332applications that are dynamically linked against shared objects provided by
333possibly removed packages. <c>revdep-rebuild</c> is part of the
334<c>gentoolkit</c> package; don't forget to emerge it first.
323<p> 335</p>
336
337<pre caption="Running revdep-rebuild">
338# <i>revdep-rebuild</i>
339</pre>
340
341<p>
324When depclean has finished, your system is using the new USE flag settings. 342When all this is accomplished, your system is using the new USE flag settings.
325</p> 343</p>
326 344
327</body> 345</body>
328</subsection> 346</subsection>
329</section> 347</section>
332<subsection> 350<subsection>
333<title>Viewing available USE-flags</title> 351<title>Viewing available USE-flags</title>
334<body> 352<body>
335 353
336<p> 354<p>
337In the next chapter on <uri link="?part=2&amp;chap=2">Portage and Software</uri>
338we will explain how to manage your installed software and how to work with
339<c>emerge</c>. However, we will give you a primer on <c>emerge</c> by showing
340you how to view what USE-flags a package uses.
341</p>
342
343<p>
344Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To 355Let us take the example of <c>mozilla</c>: what USE-flags does it listen to? To
345find out, we use <c>emerge</c> with the <c>--pretend</c> (don't really do 356find out, we use <c>emerge</c> with the <c>--pretend</c> and <c>--verbose</c>
346anything) and <c>--verbose</c> (give more output) options: 357options:
347</p> 358</p>
348 359
349<pre caption="Viewing the used USE-flags"> 360<pre caption="Viewing the used USE-flags">
350# <i>emerge --pretend --verbose mozilla</i> 361# <i>emerge --pretend --verbose mozilla</i>
351These are the packages that I would merge, in order: 362These are the packages that I would merge, in order:
361dedicated to package information called <c>etcat</c> which resides in the 372dedicated to package information called <c>etcat</c> which resides in the
362<c>gentoolkit</c> package. First, install <c>gentoolkit</c>: 373<c>gentoolkit</c> package. First, install <c>gentoolkit</c>:
363</p> 374</p>
364 375
365<pre caption="Installing gentoolkit"> 376<pre caption="Installing gentoolkit">
366# <i>emerge --usepkg gentoolkit</i> 377# <i>emerge gentoolkit</i>
367</pre> 378</pre>
368 379
369<p> 380<p>
370Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a 381Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a
371certain package. For instance, for the <c>gnumeric</c> package: 382certain package. For instance, for the <c>gnumeric</c> package:

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.20