From: Zac Medico <zmedico@gentoo.org>
Date: Fri, 30 Nov 2007 23:43:59 +0000 (-0000)
Subject: sandbox unsets ROOTPATH, so we have to back it up on the python
X-Git-Tag: v2.2_pre1~264
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eedb253d6e2fe2a0d0ab46fee26730e21a3bdafc;p=portage.git

sandbox unsets ROOTPATH, so we have to back it up on the python
side then restore it on the bash side.

svn path=/main/trunk/; revision=8768
---

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2a5a1a53d..bf9716acb 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -15,6 +15,12 @@ export SANDBOX_READ="${SANDBOX_READ}:/dev/shm:/dev/stdin:${PORTAGE_TMPDIR}"
 # environment by modifying our PATH.
 unset BASH_ENV
 
+# sandbox unsets ROOTPATH, so we have to back it up and restore it.
+if [ -n ${PORTAGE_ROOTPATH} ] ; then
+	export ROOTPATH=${PORTAGE_ROOTPATH}
+	unset PORTAGE_ROOTPATH
+fi
+
 if [ ! -z "${PORTAGE_GPG_DIR}" ]; then
 	SANDBOX_PREDICT="${SANDBOX_PREDICT}:${PORTAGE_GPG_DIR}"
 fi
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index d4539b99a..8196526b1 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -867,7 +867,7 @@ class config(object):
 		"FEATURES", "PORTAGE_BIN_PATH",
 		"PORTAGE_CONFIGROOT", "PORTAGE_DEPCACHEDIR",
 		"PORTAGE_GID", "PORTAGE_INST_GID", "PORTAGE_INST_UID",
-		"PORTAGE_PYM_PATH", "PORTDIR_OVERLAY", "ROOT", "USE_ORDER",
+		"PORTAGE_PYM_PATH", "PORTDIR_OVERLAY", "ROOT", "ROOTPATH", "USE_ORDER",
 		"XARGS",
 	]
 
@@ -2579,6 +2579,11 @@ class config(object):
 					if v is not None:
 						mydict[k] = v
 
+		# sandbox unsets ROOTPATH, so we have to back it up and restore it.
+		rootpath = mydict.get("ROOTPATH")
+		if rootpath:
+			mydict["PORTAGE_ROOTPATH"] = rootpath
+
 		return mydict
 
 	def thirdpartymirrors(self):