From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page KEYWORDS and the translation is 42% complete.
Outdated translations are marked like this.
Other languages:
This article is for anyone working on ebuilds. Most users may want to refer to other articles, such as accepting a keyword for a single package.

In an ebuild the KEYWORDS variable informs in which architectures the ebuild is stable or still in testing phase.

下面的示例包含了一些 KEYWORDS 变量可能的值:

文件 example.ebuild
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"

/var/db/repos/gentoo/profiles/arch.list 查看 keyword 列表。

上面的示例中,在各种架构前面的 ~ 前缀(波浪线字符串)意思是 该架构正处于 "测试阶段",还没有准备好用于生产。

特殊的 keywords

除了正常的 KEYWORDS 值之外,Portage 还支持三种特殊的 token。

  • * — 如果该软件包在所有系统架构都是稳定的,那么它可见。
  • ~* — 如果该软件包在所有系统架构都是测试的,那么它可见。
  • ** — 这个包总是可见。(完全忽略 KEYWORDS)。
The behavior of ~arch and ~* differ: ~arch includes arch, ~* doesn't include *. To use the most recent version of a package which is marked stable or unstable on any architecture, specify "* ~*".

Using more then one keyword

To use a recent version which is marked stable or unstable on any arch use:

文件 /etc/portage/package.accept_keywords
app-text/fdftk * ~*

To use a recent version which is marked unstable on your architecture or stable on any arch use:

文件 /etc/portage/package.accept_keywords
app-text/fdftk ~''arch'' *

Using a package that is released for another architecture only

当指定了 -* KEYWORD,这表示该软件包在所有没有在 KEYWORDS 中列出的系统上都有已知的故障。例如,一个只针对 x86 构建的二进制软件包看起来是这样的:

user $equery meta fdftk
 * app-text/fdftk [gentoo]
Maintainer: (Gentoo TeX Project)
Upstream:    None specified
Location:    /var/portage/repos/gentoo/app-text/fdftk
Keywords:    6.0-r1:0: x86 -*
License:     Adobe

如果说无论如果都要同意这个软件包,那么像这样使用 package.accept_keywords 中其他的 keyword。

文件 /etc/portage/package.accept_keywords
app-text/fdftk amd64

更多详细信息请查看 portage(5) man 手册页。