sandbox unsets ROOTPATH, so we have to back it up on the python
authorZac Medico <zmedico@gentoo.org>
Fri, 30 Nov 2007 23:46:09 +0000 (23:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 30 Nov 2007 23:46:09 +0000 (23:46 -0000)
side then restore it on the bash side. (trunk r8768)

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

bin/ebuild.sh
pym/portage.py

index 2a5a1a53dab02c95f889ce75da486545c9179d39..bf9716acb124106348350e1f2f3c7256feb81347 100755 (executable)
@@ -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
index fe8088e4cde3d643357002384aa2bb27002aab42..478ec235d177635e7ee69410d47d100021c40729 100644 (file)
@@ -1007,7 +1007,7 @@ class config:
                "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",
        ]
 
@@ -2565,6 +2565,11 @@ class config:
                                        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):