fi
if ___eapi_has_prefix_variables; then
- if [[ ${root} == / ]] ; then
+ # [[ ${root} == / ]] would be ambiguous here,
+ # since both prefixes can share root=/ while
+ # having different EPREFIX offsets.
+ if ${host_root} ; then
eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
else
eroot=${root%/}${EPREFIX}/
fi
if ___eapi_has_prefix_variables; then
- if [[ ${root} == / ]] ; then
+ # [[ ${root} == / ]] would be ambiguous here,
+ # since both prefixes can share root=/ while
+ # having different EPREFIX offsets.
+ if ${host_root} ; then
eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
else
eroot=${root%/}${EPREFIX}/
_emerge.emergelog._emerge_log_dir = emerge_log_dir
else:
_emerge.emergelog._emerge_log_dir = os.path.join(os.sep,
- emerge_config.target_config.settings["EPREFIX"].lstrip(os.sep),
- "var", "log")
+ portage.const.EPREFIX.lstrip(os.sep), "var", "log")
portage.util.ensure_dirs(_emerge.emergelog._emerge_log_dir)
if not "--pretend" in emerge_config.opts:
trees._target_eroot = settings['EROOT']
myroots = [(settings['EROOT'], settings)]
- if settings["ROOT"] == "/":
+ if settings["ROOT"] == "/" and settings["EPREFIX"] == const.EPREFIX:
trees._running_eroot = trees._target_eroot
else:
if v is not None:
clean_env[k] = v
settings = config(config_root=None, target_root="/",
- env=clean_env, eprefix=eprefix)
+ env=clean_env, eprefix=None)
settings.lock()
trees._running_eroot = settings['EROOT']
myroots.append((settings['EROOT'], settings))
test_ebuild = portdb.findname("dev-libs/A-1")
self.assertFalse(test_ebuild is None)
+ cross_prefix = os.path.join(eprefix, "cross_prefix")
+
test_commands = (
env_update_cmd,
portageq_cmd + ("envvar", "-v", "CONFIG_PROTECT", "EROOT",
emerge_cmd + ("-p", "--unmerge", "-q", eroot + "usr"),
emerge_cmd + ("--unmerge", "--quiet", "dev-libs/A"),
emerge_cmd + ("-C", "--quiet", "dev-libs/B"),
+
+ # Test cross-prefix usage, including chpathtool for binpkgs.
+ ({"EPREFIX" : cross_prefix},) + \
+ emerge_cmd + ("--usepkgonly", "dev-libs/A"),
+ ({"EPREFIX" : cross_prefix},) + \
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/A"),
+ ({"EPREFIX" : cross_prefix},) + \
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/B"),
+ ({"EPREFIX" : cross_prefix},) + \
+ emerge_cmd + ("-C", "--quiet", "dev-libs/B"),
+ ({"EPREFIX" : cross_prefix},) + \
+ emerge_cmd + ("-C", "--quiet", "dev-libs/A"),
+ ({"EPREFIX" : cross_prefix},) + \
+ emerge_cmd + ("dev-libs/A",),
+ ({"EPREFIX" : cross_prefix},) + \
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/A"),
+ ({"EPREFIX" : cross_prefix},) + \
+ portageq_cmd + ("has_version", cross_prefix, "dev-libs/B"),
)
distdir = playground.distdir