summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 44f7e212a..db1ba59fb 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7118,7 +7118,16 @@ class portdbapi(dbapi):
#self.root=settings["PORTDIR"]
self.porttree_root = os.path.realpath(porttree_root)
- self.depcachedir = self.mysettings.depcachedir[:]
+ self.depcachedir = os.path.realpath(self.mysettings.depcachedir)
+
+ if os.environ.get("SANDBOX_ON") == "1":
+ # Make api consumers exempt from sandbox violations
+ # when doing metadata cache updates.
+ sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":")
+ if self.depcachedir not in sandbox_write:
+ sandbox_write.append(self.depcachedir)
+ os.environ["SANDBOX_WRITE"] = \
+ ":".join(filter(None, sandbox_write))
self.tmpfs = self.mysettings["PORTAGE_TMPFS"]
if self.tmpfs and not os.path.exists(self.tmpfs):