* whitelist DISTDIR, PORTDIR, and PORTAGE_TMPDIR, PORTAGE_WORKDIR_MODE.
authorZac Medico <zmedico@gentoo.org>
Sat, 1 Dec 2007 03:09:06 +0000 (03:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 1 Dec 2007 03:09:06 +0000 (03:09 -0000)
* whitelist RPMDIR just for the "rpm" phase. (trunk r8779)

svn path=/main/branches/2.1.2/; revision=8780

pym/portage.py

index ee39a537dbaa6d7a760c86d68c93823d7c687653..be46e5fe36010137087f2f3d370989cc2b1082af 100644 (file)
@@ -1004,10 +1004,12 @@ class config:
        # constructor. Also, preserve XARGS since it is set by the
        # portage.data module.
        _environ_whitelist += [
-               "FEATURES", "PORTAGE_BIN_PATH",
+               "DISTDIR", "FEATURES", "PORTAGE_BIN_PATH",
                "PORTAGE_CONFIGROOT", "PORTAGE_DEPCACHEDIR",
                "PORTAGE_GID", "PORTAGE_INST_GID", "PORTAGE_INST_UID",
-               "PORTAGE_PYM_PATH", "PORTDIR_OVERLAY", "ROOT", "ROOTPATH", "USE_ORDER",
+               "PORTAGE_PYM_PATH", "PORTAGE_WORKDIR_MODE",
+               "PORTDIR", "PORTDIR_OVERLAY",
+               "ROOT", "ROOTPATH", "USE_ORDER",
                "XARGS",
        ]
 
@@ -2559,8 +2561,14 @@ class config:
                        mydict["HOME"]=mydict["BUILD_PREFIX"][:]
 
                if filter_calling_env:
-                       if "package" == self.get("EBUILD_PHASE"):
-                               for k in ("PKGDIR", ):
+                       phase = self.get("EBUILD_PHASE")
+                       if phase:
+                               whitelist = []
+                               if "package" == phase:
+                                       whitelist.append("PKGDIR")
+                               if "rpm" == phase:
+                                       whitelist.append("RPMDIR")
+                               for k in whitelist:
                                        v = self.get(k)
                                        if v is not None:
                                                mydict[k] = v