1 |
Author: zmedico |
2 |
Date: 2008-06-26 19:28:29 +0000 (Thu, 26 Jun 2008) |
3 |
New Revision: 10804 |
4 |
|
5 |
Modified: |
6 |
main/trunk/bin/portageq |
7 |
Log: |
8 |
* Remove PORTAGE_LEGACY_GLOBALS hack for portage import since late |
9 |
initialization of portage.settings (via ObjectProxy) allows us |
10 |
to rely on being able to access the portage.exception namespace |
11 |
before portage.settings is initialized. |
12 |
|
13 |
* Use portage.settings["ROOT"] instead of portage.root to avoid |
14 |
potential ObjectProxy compatibility issues. |
15 |
|
16 |
|
17 |
Modified: main/trunk/bin/portageq |
18 |
=================================================================== |
19 |
--- main/trunk/bin/portageq 2008-06-26 18:49:14 UTC (rev 10803) |
20 |
+++ main/trunk/bin/portageq 2008-06-26 19:28:29 UTC (rev 10804) |
21 |
@@ -462,23 +462,15 @@ |
22 |
|
23 |
global portage |
24 |
|
25 |
- # First import the main portage module without legacy globals since it |
26 |
- # is almost certain to succeed in that case. This provides access to |
27 |
- # the portage.exception namespace which is needed for later exception |
28 |
- # handling, like if portage.exception.PermissionDenied is raised when |
29 |
- # constructing the legacy global config instance. |
30 |
- os.environ["PORTAGE_LEGACY_GLOBALS"] = "false" |
31 |
- import portage |
32 |
- del os.environ["PORTAGE_LEGACY_GLOBALS"] |
33 |
try: |
34 |
try: |
35 |
- reload(portage) |
36 |
+ import portage |
37 |
except ImportError: |
38 |
from os import path as osp |
39 |
sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) |
40 |
import portage |
41 |
if uses_root: |
42 |
- sys.argv[2] = portage.root |
43 |
+ sys.argv[2] = portage.settings["ROOT"] |
44 |
retval = function(sys.argv[2:]) |
45 |
if retval: |
46 |
sys.exit(retval) |
47 |
|
48 |
-- |
49 |
gentoo-commits@l.g.o mailing list |