Template:Emerge

From Gentoo Wiki
Jump to:navigation Jump to:search
[edit

Documentation

Note
This page is a template. It contains some standardized, often used text, which can be transcluded inside other pages. As this template is widely used in our wiki, it may be protected in which case only staff members can change it. Use the discussion page to propose enhancements or fixes, or to voice your opinion.

Use this template to show a root level terminal prompt pre-formatted with the emerge command. By default the command is shown with the --ask command parameter.

Parameters

Parameter name Required? Default value Description
Anonymous parameter 1 Yes (n/a) One or more package names (or atoms). Use {{=}} or {{!}} in place of the characters = or |.
params+ No (n/a) emerge command parameters to be displayed in addition to the default (--ask).
params No (n/a) emerge command parameters to be displayed instead of the default (--ask).
output No (n/a) The command's output.

Note that this template does no checking to ensure its input specifies a valid emerge command (i.e., arbitrary package names and command parameters are possible). Article editors should make sure that the resulting command is correct.

Usage

See the template's testcases:


Correct

One anonymous parameter
Wiki code
{{Emerge|sys-apps/portage}}
Main version
root #emerge --ask sys-apps/portage
Sandbox version
root #emerge --ask sys-apps/portage


One anonymous parameter containing the special character =
Wiki code
{{Emerge|{{=}}sys-apps/portage-1.2.3}}
Main version
root #emerge --ask =sys-apps/portage-1.2.3
Sandbox version
root #emerge --ask =sys-apps/portage-1.2.3


One anonymous parameter containing multiple packages
Wiki code
{{Emerge|portage gentoolkit portage-utils}}
Main version
root #emerge --ask portage gentoolkit portage-utils
Sandbox version
root #emerge --ask portage gentoolkit portage-utils


Using params+ to display additional emerge command parameters
Wiki code
{{Emerge|portage|params+=--oneshot}}
Main version
root #emerge --ask --oneshot portage
Sandbox version
root #emerge --ask --oneshot portage


Using params to specify emerge command parameters in place of the default(s)
Wiki code
{{Emerge|portage|params=--pretend --nospinner}}
Main version
root #emerge --pretend --nospinner portage
Sandbox version
root #emerge --pretend --nospinner portage


Using params= (with empty value) to suppress default emerge command parameter(s)
Wiki code
{{Emerge|--info|params=}}
Main version
root #emerge --info
Sandbox version
root #emerge --info


Using output to show output
Wiki code
{{Emerge|--info|params=|output=<pre>Portage ... USE_PYTHON</pre>}}
Main version
root #emerge --info
Portage 2.3.0 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.4, glibc-2.23-r3, 3.14.27-gentoo-wl x86_64)
=================================================================
[...]
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Sandbox version
root #emerge --info
Portage 2.3.0 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.4, glibc-2.23-r3, 3.14.27-gentoo-wl x86_64)
=================================================================
[...]
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Incorrect

No parameter (exposes raw wikicode)
Wiki code
{{Emerge}}
Main version
root #emerge --ask {{{1}}}
Sandbox version
root #emerge --ask {{{1}}}


Multiple anonymous parameters (deprecated syntax)
Wiki code
{{Emerge|portage|gentoolkit|portage-utils}}
Main version
root #emerge --ask portage
This template uses deprecated syntax.
Sandbox version
root #emerge --ask portage
This template uses deprecated syntax.


↑ Multiple packages should simply be listed, space-separated, in the one required anonymous parameter, as seen in the correct usage cases above.

See also

Note
The above documentation is transcluded from Template:Emerge/doc. (edit | history)
Editors can experiment in this template's sandbox (edit) and testcases (edit) pages.
Please add categories and interwikis to the /doc subpage. (See the subpages of this template.)