1 |
Author: zmedico |
2 |
Date: 2008-04-20 20:53:33 +0000 (Sun, 20 Apr 2008) |
3 |
New Revision: 9929 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/portageq |
7 |
main/branches/2.1.2/pym/portage.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. (trunk r9928) |
12 |
|
13 |
|
14 |
Modified: main/branches/2.1.2/bin/portageq |
15 |
=================================================================== |
16 |
--- main/branches/2.1.2/bin/portageq 2008-04-20 20:50:48 UTC (rev 9928) |
17 |
+++ main/branches/2.1.2/bin/portageq 2008-04-20 20:53:33 UTC (rev 9929) |
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 |
import portage_exception |
28 |
#----------------------------------------------------------------------------- |
29 |
|
30 |
Modified: main/branches/2.1.2/pym/portage.py |
31 |
=================================================================== |
32 |
--- main/branches/2.1.2/pym/portage.py 2008-04-20 20:50:48 UTC (rev 9928) |
33 |
+++ main/branches/2.1.2/pym/portage.py 2008-04-20 20:53:33 UTC (rev 9929) |
34 |
@@ -7118,8 +7118,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.tmpfs = self.mysettings["PORTAGE_TMPFS"] |
51 |
if self.tmpfs and not os.path.exists(self.tmpfs): |
52 |
self.tmpfs = None |
53 |
|
54 |
-- |
55 |
gentoo-commits@l.g.o mailing list |