Package Names and Versions

Note

Valid characters are displayed as a regular expression, so that they can be concisely specified while still being exhaustive. Brackets ([]) are part of the regex and are not considered valid characters in any context.

Category Names

A category name may contain any of the characters [A-Za-z0-9+_.-]. It must not begin with a hyphen, a dot or a plus sign.

For consistency, the Naming Guidelines for packages should also be followed for categories.

Package Names

A package name may contain any of the characters [A-Za-z0-9+_-]. It must not begin with a hyphen or a plus sign, and must not end in a hyphen followed by anything matching the Version Syntax.

Also see Naming Guidelines.

Note

A package name does not include the category. The term qualified package name is used where a category/package pair is meant.

USE flag names

A USE flag name may contain any of the characters [A-Za-z0-9+_-]. It must begin with an alphanumeric character.

Underscores should be considered reserved for USE_EXPAND, as described in the USE Expand variables section of the USE flag guide.

Repository Names

A repository name may contain any of the characters [A-Za-z0-9_-]. It must not begin with a hyphen. In addition, every repository name must also be a valid package name.

License Names

A license name may contain any of the characters [A-Za-z0-9+_.-]. It must not begin with a hyphen, a dot or a plus sign.

Keyword names

A keyword name may contain any of the characters [A-Za-z0-9_-]. It must not begin with a hyphen. In contexts where it makes sense to do so, a keyword name may be prefixed by a tilde or a hyphen. In pybuild.Pybuild2.KEYWORDS, -* is also acceptable as a keyword.

Version Syntax

A version starts with the number part, which is in the form [0-9]+(\.[0-9]+)* (an unsigned integer, followed by zero or more dot-prefixed unsigned integers). E.g. 1.2.3

This may optionally be followed by one of [a-z] (a lowercase letter).

This may be followed by zero or more of the suffixes _alpha, _beta, _pre, _rc or _p, each of which may optionally be followed by an unsigned integer. Suffix and integer count as separate version components.

This may optionally be followed by the suffix -r followed immediately by an unsigned integer (the “revision number”). If this suffix is not present, it is assumed to be -r0.

E.g. Using all the components: 1.2.3a_alpha12-r3.

For the version comparison algorithm, see Section 3.3 of the Package Manager Specification.

External Resources

Ignoring slots, Portmod’s version specifiers are identical to Portage’s version specifiers. The following Gentoo resources may be helpful.

Portmod’s package names and versions generally follow Section 3 of the Package Manager Specification, with some exceptions. Excerpts of this section have been copied verbatim and are licensed CC-BY-SA-3.0.