summaryrefslogtreecommitdiff
blob: a522a7849b9c47e87c42e83e756b9d9400c72318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
\chapter{Names and Versions}

\section{Names}

No name may be empty. Package managers must not impose fixed upper boundaries upon the length of any
name.

\subsection{Category Names}
A category name may contain any of the characters [\t{A-Za-z0-9+\_.-}]. It must not begin with
a hyphen or a dot.

\note A hyphen is \i{not} required because of the \t{virtual} category. Usually, however, category
names will contain a hyphen.

\subsection{Package Names}
A package name may contain any of the characters [\t{A-Za-z0-9+\_-}]. It must not begin with a
hyphen, and must not end in a hyphen followed by one or more digits.

\note A package name does not include the category. The term \i{qualified package name} is used
where a \t{category/package} pair is meant.

\subsection{Slot Names}
\label{slot-names}
A slot name may contain any of the characters [\t{A-Za-z0-9+\_.-}]. It must not begin with a
hyphen or a dot.

\subsection{USE Flag Names}
A USE flag name may contain any of the characters [\t{A-Za-z0-9+\_@:-}]. It must begin with an
alphanumeric character. Underscores should be considered reserved for \t{USE\_EXPAND}, as
described in section \ref{use-expand}.

\note The at-sign is required for \t{LINGUAS}.

\TODO{Why is \t{:} in there?}

\subsection{Repository Names}
\label{repository-names}
A repository name may contain any of the characters [\t{A-Za-z0-9\_-}]. It must not begin with a
hyphen.

\subsection{Keyword Names}
\label{keyword-names}
A keyword name may contain any of the characters [\t{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 some contexts, $-*$ is also acceptable as a keyword.

\section{Version Specifications}
The package manager must not impose fixed limits upon the number of version components. No version
component represented by an integer may exceed the maximum value of a 32 bit signed two's complement
integer.

Version specifications are given as ordered integer tuples, separated by decimal points, with any or
none of the following suffixes in this order:
\begin{bulletlist}
\item One of the letters [\t{a-z}].
\item One of \t{\_alpha}, \t{\_beta}, \t{\_pre}, \t{\_rc}, and \t{\_p}, optionally followed by an
    integer. If the integer is omitted, it is assumed to be 0.
\item The string \t{-r} followed immediately by an integer (the ``revision number''). If this section
    is not present, it is assumed to be \t{-r0}.
\end{bulletlist}

\TODO{New portage allows multiple suffixes. There's bug 166522 open about this asking for the feature
    to be removed.}

\section{Version Comparison}

Version specifications are compared using strict integer comparison, moving left to right. \t{2.10}
is newer than \t{2.9}, which is newer than \t{1.500}. Any numeric value is newer than none, so
\t{1.0.0} is newer than \t{1.0} (and, by extension, \t{1.0.0\_alpha} is newer than \t{1.0}).
If the numeric parts are found to be equal, the suffixes above are considered, in the order listed.

Letter suffixes are compared alphabetically, with any letter being newer than no letter.

If letters are equal, the next part is considered. The ordering of this is complex: \t{\_alpha} is
older than \t{\_beta}, which is older than \t{\_pre}, which is older than \t{\_rc}, which is older
than no suffix, which is older than \t{\_p}. A suffix has an associated integer, which, if not
specified, defaults to \t{0}. If the two versions being compared have the same suffix, the
associated integer is compared.

If at this point the two versions are still equal, the revision number is compared. The revision
number has an optional integer suffix as per the previous part. If the revision numbers are equal,
so are the two versions.

\section{Uniqueness of versions}

No two packages in a given repository may have the same qualified package name and equal versions.
For example, a repository may not contain more than one of \t{foo-bar/baz-1.0.2},
\t{foo-bar/baz-1.0.2-r0} and \t{foo-bar/baz-1.000.2}.

% vim: set filetype=tex fileencoding=utf8 et tw=100 spell spelllang=en :