From: Zac Medico Date: Wed, 23 Jul 2008 12:33:28 +0000 (-0000) Subject: Add sandbox write access to PORTAGE_PYM_PATH before importing portage in X-Git-Tag: v2.2_rc3~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f69ef44bb57c7d1552ca015a674d50a75c2236c9;p=portage.git 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 --- 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: