summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-23 12:33:28 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-23 12:33:28 +0000
commitf69ef44bb57c7d1552ca015a674d50a75c2236c9 (patch)
treee6f5927852deb49a7e5bc485a74f1501ccf88cd2
parentfef3f5f5c4c07a7bee384ca0d8708e80bc9ee10f (diff)
downloadportage-f69ef44bb57c7d1552ca015a674d50a75c2236c9.tar.gz
portage-f69ef44bb57c7d1552ca015a674d50a75c2236c9.tar.bz2
portage-f69ef44bb57c7d1552ca015a674d50a75c2236c9.zip
Add sandbox write access to PORTAGE_PYM_PATH before importing portage in
order to avoid sandbox violations after python upgrade. svn path=/main/trunk/; revision=11175
-rwxr-xr-xbin/portageq15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/portageq b/bin/portageq
index ce6318077..117549fcb 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -476,13 +476,22 @@ def main():
sys.exit(os.EX_USAGE)
os.environ["ROOT"] = sys.argv[2]
+ # Avoid sandbox violations after python upgrade.
+ from os import path as osp
+ pym_path = osp.join(osp.dirname(
+ osp.dirname(osp.realpath(__file__))), "pym")
+ if os.environ.get("SANDBOX_ON") == "1":
+ sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
+ if pym_path not in sandbox_write:
+ sandbox_write.append(pym_path)
+ os.environ["SANDBOX_WRITE"] = \
+ ":".join(filter(None, sandbox_write))
+
global portage
try:
import portage
except ImportError:
- from os import path as osp
- sys.path.insert(0, osp.join(osp.dirname(
- osp.dirname(osp.realpath(__file__))), "pym"))
+ sys.path.insert(0, pym_path)
import portage
try: