summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/dispatch-conf5
-rw-r--r--pym/portage/dispatch_conf.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 3089329db..1cad9e011 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -85,7 +85,7 @@ class dispatch:
confs = []
count = 0
- config_root = '/'
+ config_root = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
if "log-file" in self.options:
@@ -120,7 +120,8 @@ class dispatch:
#
for path in config_paths:
- path = portage.normalize_path(path)
+ path = portage.normalize_path(
+ os.path.join(config_root, path.lstrip(os.sep)))
try:
mymode = os.stat(path).st_mode
except OSError:
diff --git a/pym/portage/dispatch_conf.py b/pym/portage/dispatch_conf.py
index 499102030..f5beba5c0 100644
--- a/pym/portage/dispatch_conf.py
+++ b/pym/portage/dispatch_conf.py
@@ -38,8 +38,9 @@ def diffstatusoutput_len(cmd):
return (1, 1)
def read_config(mandatory_opts):
- loader = KeyValuePairFileLoader(
- '/etc/dispatch-conf.conf', None)
+ eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
+ config_path = os.path.join(eprefix, "etc/dispatch-conf.conf")
+ loader = KeyValuePairFileLoader(config_path, None)
opts, errors = loader.load()
if not opts:
print(_('dispatch-conf: Error reading /etc/dispatch-conf.conf; fatal'), file=sys.stderr)