summaryrefslogtreecommitdiff
blob: 5756ff8e1777f8d3bbf6ac426291f185e0985bca (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
\chapter{Names and Versions}

\section{Restrictions upon Names}

No name may be empty. Package managers must not impose fixed upper boundaries upon the length of any
name. A package manager should indicate or reject any name that is invalid according to these rules.

\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}.

\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 \t{KEYWORDS}, \t{-*} is also acceptable as a keyword, to indicate that
a package will only work on listed targets.

A tilde prefixed keyword is, by convention, used to indicate a less stable package. It is generally
assumed that any user accepting keyword \t{\textasciitilde{}foo} will also accept \t{foo}.

The exact meaning of any keywords value is beyond the scope of this specification.

\section{Version Specifications}
The package manager must not impose fixed limits upon the number of version components. No
integer part of a version specification may contain more than eight digits. Package managers should
indicate or reject any version that is invalid according to these rules.

A version starts with the number part, which is in the form \t{[0-9]+($\backslash$.[0-9]+)*} (a positive
integer, followed by zero or more dot-prefixed positive integers).

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

This may be followed by zero or more of the suffixes \t{\_alpha}, \t{\_beta}, \t{\_pre},
\t{\_rc} or \t{\_p}, which themselves may be suffixed by an optional integer.

\IFKDEBUILDELSE
{
    In ebuilds using EAPIs listed in table~\ref{scm-table} as requiring support for the \t{-scm}
    suffix, the preceding version syntax may be either replaced or suffixed by a \t{scm} part. If
    both a ``normal'' version and a \t{scm} part are present, they must be separated by a hyphen.
}{
}

This may optionally be followed by the suffix \t{-r} followed immediately by an integer (the
``revision number''). If this suffix is not present, it is assumed to be \t{-r0}.

\IFKDEBUILDELSE
{
    \begin{centertable}{EAPIs requiring \t{scm} support} \label{scm-table}
    \begin{tabular}{ l l }
        \toprule
        \multicolumn{1}{c}{\textbf{EAPI}} &
        \multicolumn{1}{c}{\textbf{Requires \t{scm} support?}} \\
        \midrule
    \t{0} & No \\
    \t{1} & No \\
    \t{kdebuild-1} & Yes \\
    \bottomrule
    \end{tabular}
    \end{centertable}
}{
}

\section{Version Comparison}

Version specifications are compared component by component, moving from left to right.

\IFKDEBUILDELSE
{
    If a version starts with \t{scm}, it orders higher than any version that does not
    start with \t{scm}.  Otherwise, if neither version starts with \t{scm}, the
}{
    The
}
first component of the number part is compared using strict integer comparison.

Any subsequent components of the number part are compared as follows:

\begin{compactitem}
\item If neither component has a leading zero, components are compared using strict integer
  comparison.
\item Otherwise, if a component has a leading zero, any trailing zeroes in that component
  are stripped (if this makes the component empty, proceed as if it were \t{0} instead),
  and the components are compared using a stringwise comparison.
\end{compactitem}

If one number part is a prefix of the other, then the version with the longer number part is
\IFKDEBUILDELSE
{
    greater, unless the shorter part is immediately followed by \t{-scm}, in which
    case the version with the shorter part is greater.
}{
    greater.
}
Note in particular that \t{1.0} is less than \t{1.0.0}.

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

If the letters are equal, suffixes are compared. The ordering is \t{\_alpha} is less than
\t{\_beta} is less than \t{\_pre} is less than \t{\_rc} is less than no suffix is less than
\IFKDEBUILDELSE
{
    \t{\_p} is less than \t{-scm}.
}{
    \t{\_p}.
}
If a suffix string is equal, the associated integer parts
\IFKDEBUILDELSE
{
    (except for \t{scm} parts)
}{}
are compared using strict integer comparison.  A missing integer part is treated as
\IFKDEBUILDELSE
{
    zero, unless the suffix is directly followed by \t{-scm}, in which case it is treated as being
    higher than any integer.
}{
    zero.
}

If at this point the two versions are still equal, the revision number is compared using strict
integer comparison 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 :

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "pms"
%%% End: