raise portage.exception.DirectoryNotFound(var)
if config_root is None:
- config_root = EPREFIX + "/"
+ config_root = "/"
config_root = normalize_path(os.path.abspath(
config_root)).rstrip(os.path.sep) + os.path.sep
if not config_profile_path:
config_profile_path = \
- os.path.join(config_root, PROFILE_PATH.lstrip(EPREFIX + os.path.sep))
+ os.path.join(config_root, PROFILE_PATH.lstrip(os.path.sep))
if os.path.isdir(config_profile_path):
self.profile_path = config_profile_path
else:
self.module_priority = ["user","default"]
self.modules = {}
self.modules["user"] = getconfig(
- os.path.join(config_root, MODULES_FILE_PATH.lstrip(EPREFIX + os.path.sep)))
+ os.path.join(config_root, MODULES_FILE_PATH.lstrip(os.path.sep)))
if self.modules["user"] is None:
self.modules["user"] = {}
self.modules["default"] = {
self.profiles = []
if local_config:
custom_prof = os.path.join(
- config_root, CUSTOM_PROFILE_PATH.lstrip(EPREFIX + os.path.sep))
+ config_root, CUSTOM_PROFILE_PATH.lstrip(os.path.sep))
if os.path.exists(custom_prof):
self.user_profile_dir = custom_prof
self.profiles.append(custom_prof)
del rawpuseforce
make_conf = getconfig(
- os.path.join(config_root, MAKE_CONF_FILE.lstrip(EPREFIX + os.path.sep)),
+ os.path.join(config_root, MAKE_CONF_FILE.lstrip(os.path.sep)),
tolerant=tolerant, allow_sourcing=True)
if make_conf is None:
make_conf = {}
self.configdict["defaults"]=self.configlist[-1]
self.mygcfg = getconfig(
- os.path.join(config_root, MAKE_CONF_FILE.lstrip(EPREFIX + os.path.sep)),
+ os.path.join(config_root, MAKE_CONF_FILE.lstrip(os.path.sep)),
tolerant=tolerant, allow_sourcing=True, expand=expand_map)
if self.mygcfg is None:
self.mygcfg = {}
self._plicensedict = {}
self.punmaskdict = {}
abs_user_config = os.path.join(config_root,
- USER_CONFIG_PATH.lstrip(EPREFIX + os.path.sep))
+ USER_CONFIG_PATH.lstrip(os.path.sep))
# locations for "categories" and "arch.list" files
locations = [os.path.join(self["PORTDIR"], "profiles")]
noiselevel=-1)
abs_profile_path = os.path.join(self["PORTAGE_CONFIGROOT"],
- PROFILE_PATH.lstrip(EPREFIX + os.path.sep))
+ PROFILE_PATH.lstrip(os.path.sep))
if not self.profile_path or (not os.path.islink(abs_profile_path) and \
not os.path.exists(os.path.join(abs_profile_path, "parent")) and \
os.path.exists(os.path.join(self["PORTDIR"], "profiles"))):
writemsg("!!! (You can safely ignore this message when syncing. It's harmless.)\n\n\n")
abs_user_virtuals = os.path.join(self["PORTAGE_CONFIGROOT"],
- USER_VIRTUALS_FILE.lstrip(EPREFIX + os.path.sep))
+ USER_VIRTUALS_FILE.lstrip(os.path.sep))
if os.path.exists(abs_user_virtuals):
writemsg("\n!!! /etc/portage/virtuals is deprecated in favor of\n")
writemsg("!!! /etc/portage/profile/virtuals. Please move it to\n")
check_config_instance(mysettings)
custommirrors = grabdict(os.path.join(mysettings["PORTAGE_CONFIGROOT"],
- CUSTOM_MIRRORS_FILE.lstrip(EPREFIX + os.path.sep)), recursive=1)
+ CUSTOM_MIRRORS_FILE.lstrip(os.path.sep)), recursive=1)
mymirrors=[]
mysettings["T"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "temp")
mysettings["PORTAGE_BASHRC"] = os.path.join(
- mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_FILE.lstrip(EPREFIX + os.path.sep))
+ mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_FILE.lstrip(os.path.sep))
mysettings["EBUILD_EXIT_STATUS_FILE"] = os.path.join(
mysettings["PORTAGE_BUILDDIR"], ".exit_status")
if os.path.isdir(profdir):
locations.append(profdir)
locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"],
- USER_CONFIG_PATH.lstrip(EPREFIX + os.path.sep)))
+ USER_CONFIG_PATH.lstrip(os.path.sep)))
locations.reverse()
pmasklists = [(x, grablines(os.path.join(x, "package.mask"), recursive=1)) for x in locations]
os.umask(022)
kwargs = {}
- kwargs["config_root"] = os.environ.get("PORTAGE_CONFIGROOT", EPREFIX + "/")
- kwargs["target_root"] = os.environ.get("ROOT", "/")
+ for k, envvar in (("config_root", "PORTAGE_CONFIGROOT"), ("target_root", "ROOT")):
+ kwargs[k] = os.environ.get(envvar, "/")
global _initializing_globals
_initializing_globals = True
from itertools import chain
from portage.util import grabfile, write_atomic, ensure_dirs
-from portage.const import PRIVATE_PATH, USER_CONFIG_PATH, EPREFIX
+from portage.const import PRIVATE_PATH, USER_CONFIG_PATH
from portage.locks import lockfile, unlockfile
from portage import portage_gid
from portage.sets.base import PackageSet, EditablePackageSet
def multiBuilder(self, options, settings, trees):
rValue = {}
- directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(EPREFIX + os.sep), "sets"))
+ directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep), "sets"))
name_pattern = options.get("name_pattern", "${name}")
if not "$name" in name_pattern and not "${name}" in name_pattern:
raise SetConfigError("name_pattern doesn't include ${name} placeholder")
def multiBuilder(self, options, settings, trees):
rValue = {}
- directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(EPREFIX + os.sep)))
+ directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep)))
name_pattern = options.get("name_pattern", "sets/package_$suffix")
if not "$suffix" in name_pattern and not "${suffix}" in name_pattern:
raise SetConfigError("name_pattern doesn't include $suffix placeholder")