2 # Copyright 1998-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
7 # ===========================================================================
8 # START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF
9 # ===========================================================================
11 # There are two types of variables here which can easily be confused,
12 # resulting in arbitrary bugs, mainly exposed with an offset
13 # installation (Prefix). The two types relate to the usage of
14 # config_root or target_root.
15 # The first, config_root (PORTAGE_CONFIGROOT), can be a path somewhere,
16 # from which all derived paths need to be relative (e.g.
17 # USER_CONFIG_PATH) without EPREFIX prepended in Prefix. This means
18 # config_root can for instance be set to "$HOME/my/config". Obviously,
19 # in such case it is not appropriate to prepend EPREFIX to derived
20 # constants. The default value of config_root is EPREFIX (in non-Prefix
21 # the empty string) -- overriding the value loses the EPREFIX as one
23 # Second there is target_root (ROOT) which is used to install somewhere
24 # completely else, in Prefix of limited use. Because this is an offset
25 # always given, the EPREFIX should always be applied in it, hence the
26 # code always prefixes them with EROOT.
27 # The variables in this file are grouped by config_root, target_root.
29 # variables used with config_root (these need to be relative)
30 MAKE_CONF_FILE = "etc/make.conf"
31 USER_CONFIG_PATH = "etc/portage"
32 MODULES_FILE_PATH = USER_CONFIG_PATH + "/modules"
33 CUSTOM_PROFILE_PATH = USER_CONFIG_PATH + "/profile"
34 USER_VIRTUALS_FILE = USER_CONFIG_PATH + "/virtuals"
35 EBUILD_SH_ENV_FILE = USER_CONFIG_PATH + "/bashrc"
36 EBUILD_SH_ENV_DIR = USER_CONFIG_PATH + "/env"
37 CUSTOM_MIRRORS_FILE = USER_CONFIG_PATH + "/mirrors"
38 COLOR_MAP_FILE = USER_CONFIG_PATH + "/color.map"
39 PROFILE_PATH = "etc/make.profile"
40 MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults" # FIXME: not used
41 DEPRECATED_PROFILE_FILE = PROFILE_PATH + "/deprecated"
43 # variables used with targetroot (these need to be absolute, but not
44 # have a leading '/' since they are used directly with os.path.join on EROOT)
45 VDB_PATH = "var/db/pkg"
46 CACHE_PATH = "var/cache/edb"
47 PRIVATE_PATH = "var/lib/portage"
48 WORLD_FILE = PRIVATE_PATH + "/world"
49 WORLD_SETS_FILE = PRIVATE_PATH + "/world_sets"
50 CONFIG_MEMORY_FILE = PRIVATE_PATH + "/config"
51 NEWS_LIB_PATH = "var/lib/gentoo"
53 # these variables get EPREFIX prepended automagically when they are
54 # translated into their lowercase variants
55 DEPCACHE_PATH = "/var/cache/edb/dep"
56 GLOBAL_CONFIG_PATH = "/usr/share/portage/config"
58 # these variables are not used with target_root or config_root
59 PORTAGE_BASE_PATH = os.path.join(os.sep, os.sep.join(__file__.split(os.sep)[:-3]))
60 PORTAGE_BIN_PATH = PORTAGE_BASE_PATH + "/bin"
61 PORTAGE_PYM_PATH = PORTAGE_BASE_PATH + "/pym"
62 LOCALE_DATA_PATH = PORTAGE_BASE_PATH + "/locale" # FIXME: not used
63 EBUILD_SH_BINARY = PORTAGE_BIN_PATH + "/ebuild.sh"
64 MISC_SH_BINARY = PORTAGE_BIN_PATH + "/misc-functions.sh"
65 SANDBOX_BINARY = "/usr/bin/sandbox"
66 FAKEROOT_BINARY = "/usr/bin/fakeroot"
67 BASH_BINARY = "/bin/bash"
68 MOVE_BINARY = "/bin/mv"
69 PRELINK_BINARY = "/usr/sbin/prelink"
71 INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env"
72 REPO_NAME_FILE = "repo_name"
73 REPO_NAME_LOC = "profiles" + "/" + REPO_NAME_FILE
75 PORTAGE_PACKAGE_ATOM = "sys-apps/portage"
76 LIBC_PACKAGE_ATOM = "virtual/libc"
77 OS_HEADERS_PACKAGE_ATOM = "virtual/os-headers"
79 INCREMENTALS = ("USE", "USE_EXPAND", "USE_EXPAND_HIDDEN",
80 "FEATURES", "ACCEPT_KEYWORDS",
81 "CONFIG_PROTECT_MASK", "CONFIG_PROTECT",
82 "PRELINK_PATH", "PRELINK_PATH_MASK",
83 "PROFILE_ONLY_VARIABLES")
84 EBUILD_PHASES = ("pretend", "setup", "unpack", "prepare", "configure",
85 "compile", "test", "install",
86 "package", "preinst", "postinst","prerm", "postrm",
87 "nofetch", "config", "info", "other")
88 SUPPORTED_FEATURES = frozenset([
89 "assume-digests", "binpkg-logs", "buildpkg", "buildsyspkg", "candy",
90 "ccache", "chflags", "collision-protect", "compress-build-logs",
91 "digest", "distcc", "distlocks", "fakeroot",
92 "fail-clean", "fixpackages", "force-mirror", "getbinpkg",
93 "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
94 "metadata-transfer", "mirror", "multilib-strict", "news",
95 "no-ebuild-locks", "noauto", "noclean", "nodoc", "noinfo", "noman",
96 "nostrip", "notitles", "parallel-fetch", "parse-eapi-ebuild-head",
97 "prelink-checksums", "preserve-libs",
98 "protect-owned", "python-trace", "sandbox",
99 "selinux", "sesandbox", "severe", "sfperms",
100 "sign", "skiprocheck", "split-elog", "split-log", "splitdebug",
101 "strict", "stricter", "suidctl", "test", "test-fail-continue",
102 "unknown-features-filter", "unknown-features-warn",
103 "unmerge-logs", "unmerge-orphans", "userfetch", "userpriv",
104 "usersandbox", "usersync", "webrsync-gpg"])
108 HASHING_BLOCKSIZE = 32768
109 MANIFEST1_HASH_FUNCTIONS = ("MD5", "SHA256", "RMD160")
110 MANIFEST2_HASH_FUNCTIONS = ("SHA1", "SHA256", "RMD160")
112 MANIFEST1_REQUIRED_HASH = "MD5"
113 MANIFEST2_REQUIRED_HASH = "SHA1"
115 MANIFEST2_IDENTIFIERS = ("AUX", "MISC", "DIST", "EBUILD")
116 # ===========================================================================
117 # END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
118 # ===========================================================================
120 # Private constants for use in conditional code in order to minimize the diff
122 _ENABLE_DYN_LINK_MAP = True
123 _ENABLE_PRESERVE_LIBS = True
124 _ENABLE_REPO_NAME_WARN = True
125 _ENABLE_SET_CONFIG = True
126 _SANDBOX_COMPAT_LEVEL = "22"
129 # The definitions above will differ between branches, so it's useful to have
130 # common lines of diff context here in order to avoid merge conflicts.
132 if not _ENABLE_PRESERVE_LIBS:
133 SUPPORTED_FEATURES = set(SUPPORTED_FEATURES)
134 SUPPORTED_FEATURES.remove("preserve-libs")
135 SUPPORTED_FEATURES = frozenset(SUPPORTED_FEATURES)
137 if not _ENABLE_SET_CONFIG:
138 WORLD_SETS_FILE = '/dev/null'