Template:Package

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 link a package name to its listing at packages.gentoo.org in running text (or in a list).

This template should never be used inside of templates that simulate a command line interface, like {{Cmd}} and {{RootCmd}}, because the external-link icon (e.g. as with this link: "https://packages.gentoo.org", for those using a graphical browser) could confuse readers in that context. For the same resaon, it should also be avoided in templates that display special types of code, like {{FileBox}}, {{CodeBox}}, and {{KernelBox}}, except possibly in the "title" line.

To provide a link to package information in a right-floated box, use {{InfoBox package}}.

Parameters

To link a package name to its listing at packages.gentoo.org or a third-party repository

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Package name1

Package name in the form category-subcategory/packagename

Example
app-text/foo
Stringrequired
URL to third-party repourl

Third-party repository with a trailing slash at the end

Example
https://github.com/gentoo/guru/tree/master/
Stringoptional
Version numberversion

Version number for the specified package

Example
1.0.0
Stringoptional
Slot valueslot

Slot value for the specified package

Example
2
Stringoptional

The value of the required anonymous parameter must match the name of a package in the current Gentoo ebuild repository. The template does not check its input, it simply links to the provided name, so check that package names are valid. Valid package names can be determined by using for example the emerge search function on a running Gentoo system, or by searching packages.gentoo.org or browsing categories on packages.gentoo.org.

Usage

{{Package|cat-subcat/name}}
{{Package|cat-subcat/name|version=version}}
{{Package|cat-subcat/name|slot=slot}}
{{Package|cat-subcat/name|version=version|slot=slot}}

See the template's testcases:

Test cases

Correct

One anonymous parameter matching a Portage category + package name
Wiki code
{{Package|sys-apps/portage}}
Main version
Install the sys-apps/portage package for a great computing experience!
Sandbox version
Install the sys-apps/portage package for a great computing experience!


A package from a third-party repository
Wiki code
{{Package|app-office/obsidian|url=https://github.com/gentoo/guru/tree/master/}}
Main version
Try out app-office/obsidian from GURU!
Sandbox version
Try out app-office/obsidian from GURU!


Anonymous parameter matching a Portage category + package name, and a version parameter
Wiki code
{{Package|sys-devel/gcc|version=13.2.1_p20240210}}
Main version
sys-devel/gcc-13.2.1_p20240210 is the latest stable version of GCC
Sandbox version
sys-devel/gcc-13.2.1_p20240210 is the latest stable version of GCC


Anonymous parameter matching a Portage category + package name, and a slot parameter
Wiki code
{{Package|sys-devel/gcc|slot=13}}
Main version
sys-devel/gcc:12 and sys-devel/gcc:13 can both be installed on the same system
Sandbox version
sys-devel/gcc:12 and sys-devel/gcc:13 can both be installed on the same system


Anonymous parameter matching a Portage category + package name, a version parameter, and a slot parameter
Wiki code
{{Package|sys-devel/gcc|version=13.2.1_p20240113-r1|slot=13}}
Main version
Users should try upgrading to sys-devel/gcc-13.2.1_p20240113-r1:13.
Sandbox version
Users should try upgrading to sys-devel/gcc-13.2.1_p20240113-r1:13.


Incorrect

One anonymous parameter not matching a Portage category + package name (broken link)
Wiki code
{{Package|portage}}
Main version
Sandbox version


No parameter (error message)
Wiki code
{{Package}}
Main version
{{Package template error}}
Parameter 1 not defined. For correct usage see Package template's documentation on the 1 parameter.
Sandbox version
{{Package template error}}
Parameter 1 not defined. For correct usage see Package template's documentation on the 1 parameter.


See also

Note
The above documentation is transcluded from Template:Package/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.)