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:
#
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:
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)