config.environ: allow prefix vars if no EAPI
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Dec 2011 17:49:33 +0000 (09:49 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Dec 2011 17:49:33 +0000 (09:49 -0800)
This allows access to EPREFIX inside things like post_sync hooks, where
EAPI is undefined.

pym/portage/package/ebuild/config.py

index df719e2f10d5629d80a3b9c7e21f15796aaabbbd..9bb26cad064b312131824e9a81bd74f869b08118 100644 (file)
@@ -2284,9 +2284,9 @@ class config(object):
                # 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 \
+               if phase == 'depend' or \
                        ('force-prefix' not in self.features and
-                       not eapi_supports_prefix(eapi)):
+                       eapi is not None and not eapi_supports_prefix(eapi)):
                        mydict.pop("ED", None)
                        mydict.pop("EPREFIX", None)
                        mydict.pop("EROOT", None)