Template:Emerge/testcases

From Gentoo Wiki
Jump to: navigation, search
Note
This is the template test case page for Template:Emerge and its sandbox version. You may have to purge this page to update the examples.

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.