1 |
commit: 09980f19e584b644b9e2cf4d5e1e0369b6062ca1 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 1 22:51:10 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 1 22:51:10 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=09980f19 |
7 |
|
8 |
config: lazy MaskManager instantiation |
9 |
|
10 |
--- |
11 |
pym/portage/package/ebuild/config.py | 20 ++++++++++++++------ |
12 |
1 files changed, 14 insertions(+), 6 deletions(-) |
13 |
|
14 |
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py |
15 |
index 6f5680b..046ec46 100644 |
16 |
--- a/pym/portage/package/ebuild/config.py |
17 |
+++ b/pym/portage/package/ebuild/config.py |
18 |
@@ -181,6 +181,7 @@ class config(object): |
19 |
# can practically render the api unusable for api consumers. |
20 |
tolerant = hasattr(portage, '_initializing_globals') |
21 |
self._tolerant = tolerant |
22 |
+ self._unmatched_removal = _unmatched_removal |
23 |
|
24 |
self.locked = 0 |
25 |
self.mycpv = None |
26 |
@@ -205,6 +206,7 @@ class config(object): |
27 |
# For immutable attributes, use shallow copy for |
28 |
# speed and memory conservation. |
29 |
self._tolerant = clone._tolerant |
30 |
+ self._unmatched_removal = clone._unmatched_removal |
31 |
self.categories = clone.categories |
32 |
self.depcachedir = clone.depcachedir |
33 |
self.incrementals = clone.incrementals |
34 |
@@ -229,10 +231,10 @@ class config(object): |
35 |
# immutable attributes (internal policy ensures lack of mutation) |
36 |
self._locations_manager = clone._locations_manager |
37 |
self._use_manager = clone._use_manager |
38 |
- self._mask_manager = clone._mask_manager |
39 |
# force instantiation of lazy immutable objects when cloning, so |
40 |
# that they're not instantiated more than once |
41 |
self._keywords_manager_obj = clone._keywords_manager |
42 |
+ self._mask_manager_obj = clone._mask_manager |
43 |
|
44 |
# shared mutable attributes |
45 |
self._unknown_features = clone._unknown_features |
46 |
@@ -279,6 +281,7 @@ class config(object): |
47 |
else: |
48 |
# lazily instantiated objects |
49 |
self._keywords_manager_obj = None |
50 |
+ self._mask_manager_obj = None |
51 |
|
52 |
locations_manager = LocationsManager(config_root=config_root, |
53 |
config_profile_path=config_profile_path, eprefix=eprefix, |
54 |
@@ -598,11 +601,6 @@ class config(object): |
55 |
self._license_manager.extract_global_changes( \ |
56 |
self.configdict["conf"].get("ACCEPT_LICENSE", "")) |
57 |
|
58 |
- #Read package.mask and package.unmask from profiles and optionally from user config |
59 |
- self._mask_manager = MaskManager(self.repositories, profiles_complex, |
60 |
- abs_user_config, user_config=local_config, |
61 |
- strict_umatched_removal=_unmatched_removal) |
62 |
- |
63 |
self._virtuals_manager = VirtualsManager(self.profiles) |
64 |
|
65 |
if local_config: |
66 |
@@ -895,6 +893,16 @@ class config(object): |
67 |
return self._keywords_manager_obj |
68 |
|
69 |
@property |
70 |
+ def _mask_manager(self): |
71 |
+ if self._mask_manager_obj is None: |
72 |
+ self._mask_manager_obj = MaskManager(self.repositories, |
73 |
+ self._locations_manager.profiles_complex, |
74 |
+ self._locations_manager.abs_user_config, |
75 |
+ user_config=self.local_config, |
76 |
+ strict_umatched_removal=self._unmatched_removal) |
77 |
+ return self._mask_manager_obj |
78 |
+ |
79 |
+ @property |
80 |
def pkeywordsdict(self): |
81 |
result = self._keywords_manager.pkeywordsdict.copy() |
82 |
for k, v in result.items(): |