1 |
Currently there are no restrictions on license names, but obviously |
2 |
they cannot be arbitrary. (For example, they cannot end with a |
3 |
question mark because that would collide with use-conditionals.) |
4 |
|
5 |
The patch below restricts their names to the standard |
6 |
[A-Za-z0-9_][A-Za-z0-9+_.-]* set of characters. |
7 |
|
8 |
This agrees with usage in the tree. I could find only one single |
9 |
instance of a license with a deviating filename [1], which however was |
10 |
removed more than 10 years ago. |
11 |
|
12 |
Ulrich |
13 |
|
14 |
[1] https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/licenses/D%26R?hideattic=0&revision=1.1&view=markup |
15 |
|
16 |
|
17 |
From 4a48d5b25f4e9b687427d47932cc4692adad10ec Mon Sep 17 00:00:00 2001 |
18 |
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@g.o> |
19 |
Date: Thu, 9 Jun 2016 21:46:01 +0200 |
20 |
Subject: [PATCH] Specify restrictions upon license names. |
21 |
|
22 |
--- |
23 |
ebuild-vars.tex | 3 ++- |
24 |
names.tex | 5 +++++ |
25 |
2 files changed, 7 insertions(+), 1 deletion(-) |
26 |
|
27 |
diff --git a/ebuild-vars.tex b/ebuild-vars.tex |
28 |
index 1577e26..5f53c33 100644 |
29 |
--- a/ebuild-vars.tex |
30 |
+++ b/ebuild-vars.tex |
31 |
@@ -51,7 +51,8 @@ Ebuilds may define any of the following variables: |
32 |
\t{https://}, \t{ftp://} and \t{mirror://} (see section~\ref{sec:thirdpartymirrors} for mirror |
33 |
behaviour). Fetch restricted packages may include URL parts consisting of just a filename. |
34 |
See section~\ref{sec:dependencies} for full syntax. |
35 |
-\item[LICENSE] The package's license. Each text token must correspond to a tree ``licenses/'' entry |
36 |
+\item[LICENSE] The package's license. Each text token must be a valid license name, as per |
37 |
+ section~\ref{sec:license-names}, and must correspond to a tree ``licenses/'' entry |
38 |
(see section~\ref{sec:licenses-dir}). See section~\ref{sec:dependencies} for full syntax. |
39 |
\label{ebuild-var-LICENSE} |
40 |
\item[KEYWORDS] A whitespace separated list of keywords for the ebuild. Each token must be a valid |
41 |
diff --git a/names.tex b/names.tex |
42 |
index f5cc9bf..d26fed6 100644 |
43 |
--- a/names.tex |
44 |
+++ b/names.tex |
45 |
@@ -37,6 +37,11 @@ described in section~\ref{sec:use-iuse-handling}. |
46 |
A repository name may contain any of the characters [\t{A-Za-z0-9\_-}]. It must not begin with a |
47 |
hyphen. In addition, every repository name must also be a valid package name. |
48 |
|
49 |
+\subsection{License Names} |
50 |
+\label{sec:license-names} |
51 |
+A license name may contain any of the characters [\t{A-Za-z0-9+\_.-}]. It must not begin with a |
52 |
+hyphen, a dot or a plus sign. |
53 |
+ |
54 |
\subsection{Keyword Names} |
55 |
\label{sec:keyword-names} |
56 |
A keyword name may contain any of the characters [\t{A-Za-z0-9\_-}]. It must not begin with a |
57 |
-- |
58 |
2.8.4 |