chk_updated_cfg_files("/", settings.get("CONFIG_PROTECT","").split())
if myaction != "metadata":
- if os.access(portage.USER_CONFIG_PATH + "/bin/post_sync", os.X_OK):
+ postsync = os.path.join(settings["PORTAGE_CONFIGROOT"],
+ portage.USER_CONFIG_PATH, "bin", "post_sync")
+ if os.access(postsync, os.X_OK):
retval = portage.process.spawn(
- [os.path.join(portage.USER_CONFIG_PATH, "bin", "post_sync"),
- dosyncuri], env=settings.environ())
+ [postsync, dosyncuri], env=settings.environ())
if retval != os.EX_OK:
- print red(" * ")+bold("spawn failed of "+ portage.USER_CONFIG_PATH + "/bin/post_sync")
+ print red(" * ") + bold("spawn failed of " + postsync)
if(mybestpv != mypvs) and not "--quiet" in myopts:
print
if not config_profile_path:
config_profile_path = \
- os.path.join(config_root, PROFILE_PATH.lstrip(os.path.sep))
+ os.path.join(config_root, PROFILE_PATH)
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(os.path.sep)))
+ os.path.join(config_root, MODULES_FILE_PATH))
if self.modules["user"] is None:
self.modules["user"] = {}
self.modules["default"] = {
self.profiles = []
if local_config and self.profiles:
custom_prof = os.path.join(
- config_root, CUSTOM_PROFILE_PATH.lstrip(os.path.sep))
+ config_root, CUSTOM_PROFILE_PATH)
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(os.path.sep)),
+ os.path.join(config_root, MAKE_CONF_FILE),
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(os.path.sep)),
+ os.path.join(config_root, MAKE_CONF_FILE),
tolerant=tolerant, allow_sourcing=True, expand=expand_map)
if self.mygcfg is None:
self.mygcfg = {}
self.pkeywordsdict = {}
self._plicensedict = {}
self.punmaskdict = {}
- abs_user_config = os.path.join(config_root,
- USER_CONFIG_PATH.lstrip(os.path.sep))
+ abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
# locations for "categories" and "arch.list" files
locations = [os.path.join(self["PORTDIR"], "profiles")]
("sandbox" in self.features or "usersandbox" in self.features):
if self.profile_path is not None and \
os.path.realpath(self.profile_path) == \
- os.path.realpath(PROFILE_PATH):
+ os.path.realpath(os.path.join(config_root, PROFILE_PATH)):
""" Don't show this warning when running repoman and the
sandbox feature came from a profile that doesn't belong to
the user."""
noiselevel=-1)
abs_profile_path = os.path.join(self["PORTAGE_CONFIGROOT"],
- PROFILE_PATH.lstrip(os.path.sep))
+ PROFILE_PATH)
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(os.path.sep))
+ USER_VIRTUALS_FILE)
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(os.path.sep)), recursive=1)
+ CUSTOM_MIRRORS_FILE), 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(os.path.sep))
+ mysettings["PORTAGE_CONFIGROOT"], EBUILD_SH_ENV_FILE)
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(os.path.sep)))
+ USER_CONFIG_PATH))
locations.reverse()
pmasklists = [(x, grablines(os.path.join(x, "package.mask"), recursive=1)) for x in locations]
selinux_enabled = settings.selinux_enabled()
thirdpartymirrors = settings.thirdpartymirrors()
usedefaults = settings.use_defs
- profiledir = None
- if os.path.isdir(PROFILE_PATH):
- profiledir = PROFILE_PATH
+ profiledir = os.path.join(settings["PORTAGE_CONFIGROOT"], PROFILE_PATH)
+ if not os.path.isdir(profiledir):
+ profiledir = None
def flushmtimedb(record):
writemsg("portage.flushmtimedb() is DEPRECATED\n")
# ========================================================================
CACHE_PATH = "/var/cache/edb"
DEPCACHE_PATH = CACHE_PATH+"/dep"
-USER_CONFIG_PATH = "/etc/portage"
+USER_CONFIG_PATH = "etc/portage"
MODULES_FILE_PATH = USER_CONFIG_PATH+"/modules"
CUSTOM_PROFILE_PATH = USER_CONFIG_PATH+"/profile"
GLOBAL_CONFIG_PATH = "/usr/share/portage/config"
PORTAGE_PYM_PATH = PORTAGE_BASE_PATH+"/pym"
PORTAGE_PACKAGE_ATOM = "sys-apps/portage"
NEWS_LIB_PATH = "/var/lib/gentoo"
-PROFILE_PATH = "/etc/make.profile"
+PROFILE_PATH = "etc/make.profile"
LOCALE_DATA_PATH = PORTAGE_BASE_PATH+"/locale"
EBUILD_SH_BINARY = PORTAGE_BIN_PATH+"/ebuild.sh"
PRELINK_BINARY = "/usr/sbin/prelink"
WORLD_FILE = PRIVATE_PATH + "/world"
-MAKE_CONF_FILE = "/etc/make.conf"
+MAKE_CONF_FILE = "etc/make.conf"
MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults"
DEPRECATED_PROFILE_FILE = PROFILE_PATH+"/deprecated"
USER_VIRTUALS_FILE = USER_CONFIG_PATH+"/virtuals"
def multiBuilder(self, options, settings, trees):
rValue = {}
- directory = options.get("directory", os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH.lstrip(os.sep), "sets"))
+ directory = options.get("directory",
+ os.path.join(settings["PORTAGE_CONFIGROOT"],
+ USER_CONFIG_PATH, "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(os.sep)))
+ directory = options.get("directory",
+ os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH))
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"))