/[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.21
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
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.21 2004/10/21 10:31:20 swift Exp $ -->
8 8
9<sections> 9<sections>
10<section> 10<section>
11<title>What are USE-flags?</title> 11<title>What are USE-flags?</title>
12<subsection> 12<subsection>
13<title>The ideas behind USE-flags</title> 13<title>The ideas behind USE-flags</title>
14<body> 14<body>
15 15
16<p> 16<p>
17When you are installing Gentoo (or any other distribution, or even operating 17When you are installing Gentoo (or any other distribution, or even operating
18system for that matter) you make choices depending on the environment you are 18system for that matter) you make choices depending on the environment you are
19working with. A setup for a server differs from a setup for a workstation. 19working with. A setup for a server differs from a setup for a workstation.
20A gaming workstation differs from a 3D rendering workstation. 20A gaming workstation differs from a 3D rendering workstation.
21</p> 21</p>
22 22
198<body> 198<body>
199 199
200<p> 200<p>
201Sometimes you want to set a certain USE-setting only once. Instead of editing 201Sometimes you want to set a certain USE-setting only once. Instead of editing
202<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just 202<path>/etc/make.conf</path> twice (to do and undo the USE-changes) you can just
203declare the USE-variable as environment variable. Remember that, when you 203declare the USE-variable as environment variable. Remember that, when you
204re-emerge or update this application (either explicitly or as part of a system 204re-emerge or update this application (either explicitly or as part of a system
205update) your changes will be lost! 205update) your changes will be lost!
206</p> 206</p>
207 207
208<p> 208<p>
209As an example we will temporarily remove java from the USE-setting 209As an example we will temporarily remove java from the USE-setting
210during the installation of mozilla. 210during the installation of mozilla.
211</p> 211</p>
212 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
218<pre caption="Using USE as environment variable"> 213<pre caption="Using USE as environment variable">
219# <i>USE="-java" emerge mozilla</i> 214# <i>USE="-java" emerge mozilla</i>
220</pre> 215</pre>
221 216
222</body> 217</body>
223</subsection> 218</subsection>
224<subsection> 219<subsection>
225<title>Inheriting USE-flags</title> 220<title>Inheriting USE-flags</title>
226<body> 221<body>
227 222
228<p> 223<p>
229Some packages don't only listen to USE-flags, but also provide USE-flags. When 224Some packages don't only listen to USE-flags, but also provide USE-flags. When
230you install such a package, the USE-flag they provide is added to your USE 225you install such a package, the USE-flag they provide is added to your USE
231setting. To view the list of packages that provide a USE-flag, check 226setting. To view the list of packages that provide a USE-flag, check
232<path>/etc/make.profile/use.defaults</path>: 227<path>/etc/make.profile/use.defaults</path>:
278the content used by Portage. 273the content used by Portage.
279</p> 274</p>
280 275
281<pre caption="Running emerge info"> 276<pre caption="Running emerge info">
282# <i>emerge info</i> 277# <i>emerge info</i>
283</pre> 278</pre>
284 279
285</body> 280</body>
286</subsection> 281</subsection>
287<subsection> 282<subsection>
288<title>Adapting your Entire System to New USE Flags</title> 283<title>Adapting your Entire System to New USE Flags</title>
289<body> 284<body>
290 285
291<p> 286<p>
292If you have altered your USE flags and you wish to update your entire system to 287If 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. 288use 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> 289</p>
301 290
302<pre caption="Rebuilding your entire system"> 291<pre caption="Rebuilding your entire system">
303# <i>emerge --emptytree world</i> 292# <i>emerge --update --deep --newuse world</i>
304</pre> 293</pre>
305 294
306<p> 295<p>
307Next, run Portage's depclean to remove the conditional dependencies that 296Next, 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 297were emerged on your "old" system but that have been obsoleted by the new USE
309flags. 298flags.
310</p> 299</p>
311 300
312<warn> 301<warn>
313Running <c>emerge depclean</c> is a dangerous operation and should be handled 302Running <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 303with 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 304it 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. 305<c>-p</c> switch to have depclean only list the packages without removing them.
317</warn> 306</warn>
318 307
319<pre caption="Removing obsoleted packages"> 308<pre caption="Removing obsoleted packages">
320# <i>emerge -p depclean</i> 309# <i>emerge -p depclean</i>
321</pre> 310</pre>
322 311
323<p> 312<p>
313When depclean has finished, run <c>revdep-rebuild</c> to rebuild the
314applications that are dynamically linked against shared objects provided by
315possibly removed packages. <c>revdep-rebuild</c> is part of the
316<c>gentoolkit</c> package; don't forget to emerge it first.
317</p>
318
319<pre caption="Running revdep-rebuild">
320# <i>revdep-rebuild</i>
321</pre>
322
323<p>
324When depclean has finished, your system is using the new USE flag settings. 324When all this is accomplished, your system is using the new USE flag settings.
325</p> 325</p>
326 326
327</body> 327</body>
328</subsection> 328</subsection>
329</section> 329</section>
330<section> 330<section>
331<title>Package specific USE-flags</title> 331<title>Package specific USE-flags</title>
332<subsection> 332<subsection>
333<title>Viewing available USE-flags</title> 333<title>Viewing available USE-flags</title>
334<body> 334<body>
335 335
336<p> 336<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 337Let 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 338find out, we use <c>emerge</c> with the <c>--pretend</c> and <c>--verbose</c>
346anything) and <c>--verbose</c> (give more output) options: 339options:
347</p> 340</p>
348 341
349<pre caption="Viewing the used USE-flags"> 342<pre caption="Viewing the used USE-flags">
350# <i>emerge --pretend --verbose mozilla</i> 343# <i>emerge --pretend --verbose mozilla</i>
351These are the packages that I would merge, in order: 344These are the packages that I would merge, in order:
352 345
353Calculating dependencies ...done! 346Calculating dependencies ...done!
354[ebuild N ] net-www/mozilla-1.5-r1 +java +crypt -ipv6 -gtk2 +ssl +ldap 347[ebuild N ] net-www/mozilla-1.5-r1 +java +crypt -ipv6 -gtk2 +ssl +ldap
355+gnome -debug +mozcalendar -mozaccess -mozxmlterm -moznoirc -moznomail 348+gnome -debug +mozcalendar -mozaccess -mozxmlterm -moznoirc -moznomail
356-moznocompose -moznoxft 349-moznocompose -moznoxft
357</pre> 350</pre>
358 351
359<p> 352<p>
360<c>emerge</c> isn't the only tool for this job. In fact, we have a tool 353<c>emerge</c> isn't the only tool for this job. In fact, we have a tool
361dedicated to package information called <c>etcat</c> which resides in the 354dedicated to package information called <c>etcat</c> which resides in the
362<c>gentoolkit</c> package. First, install <c>gentoolkit</c>: 355<c>gentoolkit</c> package. First, install <c>gentoolkit</c>:
363</p> 356</p>
364 357
365<pre caption="Installing gentoolkit"> 358<pre caption="Installing gentoolkit">
366# <i>emerge --usepkg gentoolkit</i> 359# <i>emerge gentoolkit</i>
367</pre> 360</pre>
368 361
369<p> 362<p>
370Now run <c>etcat</c> with the <c>uses</c> argument to view the USE-flags of a 363Now 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: 364certain package. For instance, for the <c>gnumeric</c> package:
372</p> 365</p>
373 366
374<pre caption="Using etcat to view used USE-flags"> 367<pre caption="Using etcat to view used USE-flags">
375# <i>etcat uses gnumeric</i> 368# <i>etcat uses gnumeric</i>
376[ Colour Code : <i>set</i> <comment>unset</comment> ] 369[ Colour Code : <i>set</i> <comment>unset</comment> ]
377[ Legend : (U) Col 1 - Current USE flags ] 370[ Legend : (U) Col 1 - Current USE flags ]
378[ : (I) Col 2 - Installed With USE flags ] 371[ : (I) Col 2 - Installed With USE flags ]
379 372
380 U I [ Found these USE variables in : app-office/gnumeric-1.2.0 ] 373 U I [ Found these USE variables in : app-office/gnumeric-1.2.0 ]
381 - - <comment>libgda</comment> : Adds GNU Data Access (CORBA wrapper) support for gnumeric 374 - - <comment>libgda</comment> : Adds GNU Data Access (CORBA wrapper) support for gnumeric

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

  ViewVC Help
Powered by ViewVC 1.1.20