1 |
Author: zmedico |
2 |
Date: 2008-04-20 20:50:48 +0000 (Sun, 20 Apr 2008) |
3 |
New Revision: 9928 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/portageq |
7 |
main/trunk/pym/portage/dbapi/porttree.py |
8 |
Log: |
9 |
Bug #218559 - Make portdbapi automatically add sandbox write access to |
10 |
self.depcachedir when appropriate. This makes the portageq blanket sandbox |
11 |
exemption unnecessary. |
12 |
|
13 |
|
14 |
Modified: main/trunk/bin/portageq |
15 |
=================================================================== |
16 |
--- main/trunk/bin/portageq 2008-04-19 13:12:11 UTC (rev 9927) |
17 |
+++ main/trunk/bin/portageq 2008-04-20 20:50:48 UTC (rev 9928) |
18 |
@@ -21,10 +21,6 @@ |
19 |
|
20 |
import os |
21 |
|
22 |
-# This allows portageq to be exempt from sandbox, |
23 |
-# for things like updating metadata cache. |
24 |
-os.environ["SANDBOX_ON"] = "0" |
25 |
- |
26 |
import types |
27 |
|
28 |
#----------------------------------------------------------------------------- |
29 |
|
30 |
Modified: main/trunk/pym/portage/dbapi/porttree.py |
31 |
=================================================================== |
32 |
--- main/trunk/pym/portage/dbapi/porttree.py 2008-04-19 13:12:11 UTC (rev 9927) |
33 |
+++ main/trunk/pym/portage/dbapi/porttree.py 2008-04-20 20:50:48 UTC (rev 9928) |
34 |
@@ -62,8 +62,17 @@ |
35 |
#self.root=settings["PORTDIR"] |
36 |
self.porttree_root = os.path.realpath(porttree_root) |
37 |
|
38 |
- self.depcachedir = self.mysettings.depcachedir[:] |
39 |
+ self.depcachedir = os.path.realpath(self.mysettings.depcachedir) |
40 |
|
41 |
+ if os.environ.get("SANDBOX_ON") == "1": |
42 |
+ # Make api consumers exempt from sandbox violations |
43 |
+ # when doing metadata cache updates. |
44 |
+ sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":") |
45 |
+ if self.depcachedir not in sandbox_write: |
46 |
+ sandbox_write.append(self.depcachedir) |
47 |
+ os.environ["SANDBOX_WRITE"] = \ |
48 |
+ ":".join(filter(None, sandbox_write)) |
49 |
+ |
50 |
self.eclassdb = eclass_cache.cache(self.porttree_root, |
51 |
overlays=self.mysettings["PORTDIR_OVERLAY"].split()) |
52 |
|
53 |
|
54 |
-- |
55 |
gentoo-commits@l.g.o mailing list |