confs = []
count = 0
- config_root = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
+ config_root = portage.const.EPREFIX or os.sep
self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
if "log-file" in self.options:
if options.portdir is not None:
env['PORTDIR'] = options.portdir
- eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
+ eprefix = portage.const.EPREFIX
settings = portage.config(config_root=config_root,
local_config=False, env=env, _eprefix=eprefix)
sys.stderr.write("Run portageq with --help for info\n")
sys.stderr.flush()
sys.exit(os.EX_USAGE)
- eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
+ eprefix = portage.const.EPREFIX
eroot = portage.util.normalize_path(sys.argv[2])
if eprefix:
root = eroot[:1-len(eprefix)]
# behave incrementally.
repoman_incrementals = tuple(x for x in \
portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
-eprefix = os.environ.get("__REPOMAN_TEST_EPREFIX")
+eprefix = portage.const.EPREFIX
repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
repoman_settings.lock()
if env is None:
env = os.environ
eprefix = env.get("__PORTAGE_TEST_EPREFIX")
+ if eprefix is None:
+ eprefix = portage.const.EPREFIX
settings = config(config_root=config_root, target_root=target_root,
env=env, _eprefix=eprefix)
settings.lock()
if EPREFIX:
EPREFIX = os.path.normpath(EPREFIX)
-elif EPREFIX:
- # Propagate the constant to other portage code which uses this variable.
- os.environ["__PORTAGE_TEST_EPREFIX"] = EPREFIX
-
# ===========================================================================
# END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANTS -- END OF CONSTANT
# ===========================================================================
secpass = 0
if uid == 0:
secpass = 2
- elif "__PORTAGE_TEST_EPREFIX" in os.environ:
+ elif portage.const.EPREFIX:
secpass = 2
#Discover the uid and gid of the portage user/group
try:
return (1, 1)
def read_config(mandatory_opts):
- eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
- config_path = os.path.join(eprefix, "etc/dispatch-conf.conf")
+ eprefix = portage.const.EPREFIX
+ config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf")
loader = KeyValuePairFileLoader(config_path, None)
opts, errors = loader.load()
if not opts:
pythonpath = PORTAGE_PYM_PATH + pythonpath
env = {
- "__REPOMAN_TEST_EPREFIX" : eprefix,
+ "__PORTAGE_TEST_EPREFIX" : eprefix,
"DISTDIR" : distdir,
"GENTOO_COMMITTER_NAME" : committer_name,
"GENTOO_COMMITTER_EMAIL" : committer_email,
target_root = portage.settings["ROOT"]
target_eroot = portage.settings['EROOT']
else:
- eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", "")
+ eprefix = portage.const.EPREFIX
target_eroot = os.path.join(target_root,
eprefix.lstrip(os.sep))
target_eroot = target_eroot.rstrip(os.sep) + os.sep