summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-07 22:22:31 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-07 22:22:31 -0800
commitff52f9dc31004becb8022e6437088d01917f413c (patch)
tree0f333c6bf4c09f751d993ef843089f8b5c80ef2e /pym
parentc93a46851c43f7e8539a67b2376dc8f55af41789 (diff)
downloadportage-ff52f9dc31004becb8022e6437088d01917f413c.tar.gz
portage-ff52f9dc31004becb8022e6437088d01917f413c.tar.bz2
portage-ff52f9dc31004becb8022e6437088d01917f413c.zip
Make USE=prefix enable EPREFIX in all EAPIs.
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).
Diffstat (limited to 'pym')
-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)