From 3bd94dbffd4cf338de8cc786f60525b0a84d2562 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 8 Dec 2011 09:46:55 -0800 Subject: Support FEATURES=force-prefix. This adjusts the logic from commit ff52f9dc31004becb8022e6437088d01917f413c to use FEATURES=force-prefix instead of USE=prefix. This has the advantage that we don't have to make any assumptions about the USE=prefix. --- pym/portage/const.py | 2 +- pym/portage/package/ebuild/config.py | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'pym') diff --git a/pym/portage/const.py b/pym/portage/const.py index 29c3878a6..3dad36a2e 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -90,7 +90,7 @@ SUPPORTED_FEATURES = frozenset([ "ccache", "chflags", "clean-logs", "collision-protect", "compress-build-logs", "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot", - "fail-clean", "force-mirror", "getbinpkg", + "fail-clean", "force-mirror", "force-prefix", "getbinpkg", "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", "metadata-transfer", "mirror", "multilib-strict", "news", "noauto", "noclean", "nodoc", "noinfo", "noman", diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 1ccaee7c8..fb79e5ee1 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -2238,17 +2238,14 @@ class config(object): if not eapi_exports_merge_type(eapi): mydict.pop("MERGE_TYPE", None) - # 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). + # Prefix variables are supported beginning with EAPI 3, or when + # force-prefix is in FEATURES, since 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")): + ('force-prefix' not in self.features and + not eapi_supports_prefix(eapi)): mydict.pop("ED", None) mydict.pop("EPREFIX", None) mydict.pop("EROOT", None) -- cgit v1.2.3-1-g7c22