summaryrefslogtreecommitdiffstats
path: root/pym/portage/package/ebuild/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/package/ebuild/config.py')
-rw-r--r--pym/portage/package/ebuild/config.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py
index 2995740bc..1ccaee7c8 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -2238,8 +2238,17 @@ class config(object):
if not eapi_exports_merge_type(eapi):
mydict.pop("MERGE_TYPE", None)
- # Prefix variables are supported starting with EAPI 3.
- if phase == 'depend' or eapi is None or not eapi_supports_prefix(eapi):
+ # Prefix variables are supported beginning with EAPI 3, or when EPREFIX
+ # is non-empty (implying that EPREFIX support is required in the
+ # current environment, regardless of EAPI). For EAPIs prior to 3,
+ # ebuild helpers rely on these variables only when USE=prefix is
+ # enabled. This is safe because the prefix flag should be masked in all
+ # non-prefix profiles, and older EAPIs would otherwise be useless with
+ # prefix configurations. This brings compatibility with the prefix
+ # branch of portage, which also supports EPREFIX for all EAPIs (for
+ # obvious reasons).
+ if phase == 'depend' or eapi is None or \
+ (not eapi_supports_prefix(eapi) and not mydict.get("EPREFIX")):
mydict.pop("ED", None)
mydict.pop("EPREFIX", None)
mydict.pop("EROOT", None)