* By default, disable the calc_prelink parameter to perform_md5() for
[portage.git] / pym / portage / const.py
1 # portage: Constants
2 # Copyright 1998-2009 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 import os
6
7 # ===========================================================================
8 # START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF
9 # ===========================================================================
10
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
22 # would expect.
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.  Those
26 # constants (like VDB_PATH) are always absolute and hence DO have
27 # EPREFIX prepended in Prefix.
28 # The variables in this file are grouped by config_root, target_root.
29
30 # variables used with config_root (these need to be relative)
31 MAKE_CONF_FILE           = "etc/make.conf"
32 USER_CONFIG_PATH         = "etc/portage"
33 MODULES_FILE_PATH        = USER_CONFIG_PATH + "/modules"
34 CUSTOM_PROFILE_PATH      = USER_CONFIG_PATH + "/profile"
35 USER_VIRTUALS_FILE       = USER_CONFIG_PATH + "/virtuals"
36 EBUILD_SH_ENV_FILE       = USER_CONFIG_PATH + "/bashrc"
37 EBUILD_SH_ENV_DIR        = USER_CONFIG_PATH + "/env"
38 CUSTOM_MIRRORS_FILE      = USER_CONFIG_PATH + "/mirrors"
39 COLOR_MAP_FILE           = USER_CONFIG_PATH + "/color.map"
40 PROFILE_PATH             = "etc/make.profile"
41 MAKE_DEFAULTS_FILE       = PROFILE_PATH + "/make.defaults"  # FIXME: not used
42 DEPRECATED_PROFILE_FILE  = PROFILE_PATH + "/deprecated"
43
44 # variables used with targetroot (these need to be absolute, but not
45 # have a leading '/' since they are used directly with os.path.join)
46 VDB_PATH                 = "var/db/pkg"
47 CACHE_PATH               = "var/cache/edb"
48 PRIVATE_PATH             = "var/lib/portage"
49 WORLD_FILE               = PRIVATE_PATH + "/world"
50 WORLD_SETS_FILE          = PRIVATE_PATH + "/world_sets"
51 CONFIG_MEMORY_FILE       = PRIVATE_PATH + "/config"
52 NEWS_LIB_PATH            = "var/lib/gentoo"
53
54 # these variables are not used with target_root or config_root
55 DEPCACHE_PATH            = "/var/cache/edb/dep"
56 GLOBAL_CONFIG_PATH       = "/usr/share/portage/config"
57 PORTAGE_BASE_PATH        = os.path.join(os.sep, os.sep.join(__file__.split(os.sep)[:-3]))
58 PORTAGE_BIN_PATH         = PORTAGE_BASE_PATH + "/bin"
59 PORTAGE_PYM_PATH         = PORTAGE_BASE_PATH + "/pym"
60 LOCALE_DATA_PATH         = PORTAGE_BASE_PATH + "/locale"  # FIXME: not used
61 EBUILD_SH_BINARY         = PORTAGE_BIN_PATH + "/ebuild.sh"
62 MISC_SH_BINARY           = PORTAGE_BIN_PATH + "/misc-functions.sh"
63 SANDBOX_BINARY           = "/usr/bin/sandbox"
64 FAKEROOT_BINARY          = "/usr/bin/fakeroot"
65 BASH_BINARY              = "/bin/bash"
66 MOVE_BINARY              = "/bin/mv"
67 PRELINK_BINARY           = "/usr/sbin/prelink"
68
69 INVALID_ENV_FILE         = "/etc/spork/is/not/valid/profile.env"
70 REPO_NAME_FILE           = "repo_name"
71 REPO_NAME_LOC            = "profiles" + "/" + REPO_NAME_FILE
72
73 PORTAGE_PACKAGE_ATOM     = "sys-apps/portage"
74 LIBC_PACKAGE_ATOM        = "virtual/libc"
75 OS_HEADERS_PACKAGE_ATOM  = "virtual/os-headers"
76
77 INCREMENTALS             = ("USE", "USE_EXPAND", "USE_EXPAND_HIDDEN",
78                            "FEATURES", "ACCEPT_KEYWORDS",
79                            "CONFIG_PROTECT_MASK", "CONFIG_PROTECT",
80                            "PRELINK_PATH", "PRELINK_PATH_MASK",
81                            "PROFILE_ONLY_VARIABLES")
82 EBUILD_PHASES            = ("pretend", "setup", "unpack", "prepare", "configure",
83                            "compile", "test", "install",
84                            "package", "preinst", "postinst","prerm", "postrm",
85                            "nofetch", "config", "info", "other")
86 SUPPORTED_FEATURES       = frozenset([
87                            "assume-digests", "buildpkg", "buildsyspkg", "ccache",
88                            "collision-protect", "compress-build-logs",
89                            "digest", "distcc", "distlocks",
90                            "fakeroot", "fail-clean", "fixpackages", "getbinpkg",
91                            "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
92                            "metadata-transfer", "mirror", "multilib-strict", "news",
93                            "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip",
94                            "notitles", "parallel-fetch", "parse-eapi-ebuild-head",
95                            "parse-eapi-glep-55", "prelink-checksums", "preserve-libs",
96                            "protect-owned", "python-trace", "sandbox",
97                            "sesandbox", "severe", "sfperms",
98                            "sign", "skiprocheck", "split-elog", "split-log", "splitdebug",
99                            "strict", "stricter", "suidctl", "test", "test-fail-continue",
100                            "unknown-features-warn",
101                            "unmerge-logs", "unmerge-orphans", "userfetch", "userpriv",
102                            "usersandbox", "usersync", "webrsync-gpg"])
103
104 EAPI                     = 3
105
106 HASHING_BLOCKSIZE        = 32768
107 MANIFEST1_HASH_FUNCTIONS = ("MD5", "SHA256", "RMD160")
108 MANIFEST2_HASH_FUNCTIONS = ("SHA1", "SHA256", "RMD160")
109
110 MANIFEST1_REQUIRED_HASH  = "MD5"
111 MANIFEST2_REQUIRED_HASH  = "SHA1"
112
113 MANIFEST2_IDENTIFIERS    = ("AUX", "MISC", "DIST", "EBUILD")
114 # ===========================================================================
115 # END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
116 # ===========================================================================