from portage.exception import DirectoryNotFound, PortageException
from portage.versions import ververify
from portage.dep import dep_getkey, get_operator, isvalidatom, isjustname
-from portage.const import USER_CONFIG_PATH, WORLD_FILE
+from portage.const import USER_CONFIG_PATH, WORLD_FILE, EPREFIX
ignored_dbentries = ("CONTENTS", "environment.bz2")
myxfiles = ["package.mask", "package.unmask", \
"package.keywords", "package.use"]
myxfiles += [os.path.join("profile", x) for x in myxfiles]
- abs_user_config = os.path.join(config_root,
- USER_CONFIG_PATH.lstrip(os.path.sep))
+ # if the user gives a path, respect it, otherwise use our prefix
+ if USER_CONFIG_PATH != "":
+ abs_user_config = os.path.join(config_root,
+ USER_CONFIG_PATH.lstrip(os.path.sep))
+ else:
+ abs_user_config = os.path.join(config_root,
+ EPREFIX.lstrip(os.path.sep))
recursivefiles = []
for x in myxfiles:
config_file = os.path.join(abs_user_config, x)
OperationNotPermitted, PermissionDenied, ReadOnlyFileSystem
import portage.exception
from portage.dep import isvalidatom
+from portage.const import EPREFIX
import os, errno, shlex, stat, string, sys
try:
self._dirs = set()
for x in self.protect_list:
ppath = normalize_path(
- os.path.join(self.myroot, x.lstrip(os.path.sep)))
+ os.path.join(self.myroot + EPREFIX, x.lstrip(os.path.sep)))
mystat = None
try:
if stat.S_ISDIR(os.stat(ppath).st_mode):
self.protectmask = []
for x in self.mask_list:
ppath = normalize_path(
- os.path.join(self.myroot, x.lstrip(os.path.sep)))
+ os.path.join(self.myroot + EPREFIX, x.lstrip(os.path.sep)))
mystat = None
try:
"""Use lstat so that anything, even a broken symlink can be