# behave incrementally.
repoman_incrementals = tuple(x for x in \
portage.const.INCREMENTALS if x != 'ACCEPT_KEYWORDS')
- repoman_settings = portage.config(local_config=False, _eprefix=EPREFIX)
+ eprefix = os.environ.get("__REPOMAN_TEST_EPREFIX")
++if not eprefix:
++ eprefix = EPREFIX
+ repoman_settings = portage.config(local_config=False, _eprefix=eprefix)
repoman_settings.lock()
if repoman_settings.get("NOCOLOR", "").lower() in ("yes", "true") or \
portdbapi.portdbapi_instances.remove(portdb)
del trees[myroot]["porttree"], myroot, portdb
+ eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
++ if not eprefix:
++ eprefix = EPREFIX
settings = config(config_root=config_root, target_root=target_root,
- config_incrementals=portage.const.INCREMENTALS, _eprefix=EPREFIX)
+ config_incrementals=portage.const.INCREMENTALS, _eprefix=eprefix)
settings.lock()
myroots = [(settings["ROOT"], settings)]
if prev_mtimes is None:
prev_mtimes = portage.mtimedb["ldpath"]
if env is None:
- env = os.environ
- envd_dir = os.path.join(target_root, EPREFIX_LSTRIP, "etc", "env.d")
+ settings = os.environ
++ if 'EPREFIX' not in settings:
++ settings['EPREFIX'] = portage.const.EPREFIX
+ else:
+ settings = env
+
+ eprefix = settings.get("EPREFIX", "")
+ eprefix_lstrip = eprefix.lstrip(os.sep)
+ envd_dir = os.path.join(target_root, eprefix_lstrip, "etc", "env.d")
ensure_dirs(envd_dir, mode=0o755)
fns = listdir(envd_dir, EmptyOnError=1)
fns.sort()
penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n"
penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n"
cenvnotice = penvnotice[:]
- penvnotice += "# GO INTO " + EPREFIX + "/etc/profile NOT /etc/profile.env\n\n"
- cenvnotice += "# GO INTO " + EPREFIX + "/etc/csh.cshrc NOT /etc/csh.env\n\n"
- penvnotice += "# GO INTO /etc/profile NOT /etc/profile.env\n\n"
- cenvnotice += "# GO INTO /etc/csh.cshrc NOT /etc/csh.env\n\n"
++ penvnotice += "# GO INTO " + eprefix + "/etc/profile NOT /etc/profile.env\n\n"
++ cenvnotice += "# GO INTO " + eprefix + "/etc/csh.cshrc NOT /etc/csh.env\n\n"
#create /etc/profile.env for bash support
- outfile = atomic_ofstream(os.path.join(target_root, EPREFIX_LSTRIP, "etc", "profile.env"))
+ outfile = atomic_ofstream(os.path.join(
+ target_root, eprefix_lstrip, "etc", "profile.env"))
outfile.write(penvnotice)
env_keys = [ x for x in env if x != "LDPATH" ]
exit_status="0"
for version in ${PYTHON_VERSIONS}; do
- if [[ -x /usr/bin/python${version} ]]; then
+ if [[ -x @PREFIX_PORTAGE_PYTHON@${version} ]]; then
echo -e "${GOOD}Testing with Python ${version}...${NORMAL}"
- if ! @PREFIX_PORTAGE_PYTHON@${version} pym/portage/tests/runTests "$@" ; then
- if ! /usr/bin/python${version} -Wd pym/portage/tests/runTests "$@" ; then
++ if ! @PREFIX_PORTAGE_PYTHON@${version} -Wd pym/portage/tests/runTests "$@" ; then
echo -e "${BAD}Testing with Python ${version} failed${NORMAL}"
exit_status="1"
fi