From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page CONFIG PROTECT and the translation is 17% complete.
Outdated translations are marked like this.

Warning: Display title "CONFIG_PROTECT" overrides earlier display title "CONFIG PROTECT".

CONFIG_PROTECT 变量包含用空格分隔的目录列表,Portage不会盲目的拷贝新版本的文件到这些目录中,而是将这些目录中的文件当做配置文件,由用户手动检查更新是否需要和正确。可以通过 CONFIG_PROTECT_MASK 变量排除列出目录的子目录。

A current list of presently protected locations can be displayed with portageq:

user $portageq envvar CONFIG_PROTECT
/etc /usr/share/config /usr/share/gnupg/qualified.txt

Using portageq is a short hand alternative to running a regular expression search on verbose, informational output from the emerge command:

user $emerge --verbose --info | grep -E '^CONFIG_PROTECT='
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"

Files or subdirectories defined within the CONFIG_PROTECT can be excluded from protection through the CONFIG_PROTECT_MASK variable. Masking is useful when a parent directory should be protected, but a certain child directory beneath it.

该变量有一个合理的默认设置,该设置由 Portage 安装处理,并包含用户的 Gentoo profile。它可以通过系统环境(通过/etc/env.d文件更新的变量,通常用于应用程序)以及用户/etc/portage/make.conf 中设定中的条目来扩展。

文件 /etc/portage/make.confCONFIG_PROTECT 定义示例

另请参考 Gentoo 手册中的 环境变量 章节。

See also