diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-01-30 13:48:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-01-30 13:48:48 +0000 |
commit | 3b1fea64824744f06697ee23d3e6bf28721325b9 (patch) | |
tree | 4cff344e08e94ebdc7443c03a09b6e114fa1d55d | |
parent | 8c34dce739d8ca71567561cbf81ececb166c68bd (diff) | |
download | portage-3b1fea64824744f06697ee23d3e6bf28721325b9.tar.gz portage-3b1fea64824744f06697ee23d3e6bf28721325b9.tar.bz2 portage-3b1fea64824744f06697ee23d3e6bf28721325b9.zip |
For immutable config attributes, use shallow copy for speed and memory
conservation.
svn path=/main/trunk/; revision=15285
-rw-r--r-- | pym/portage/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index e9acf1178..bfb834a85 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1583,12 +1583,14 @@ class config(object): if clone: # For immutable attributes, use shallow copy for # speed and memory conservation. + self.categories = clone.categories self.depcachedir = clone.depcachedir self.incrementals = clone.incrementals self.module_priority = clone.module_priority self.profile_path = clone.profile_path self.profiles = clone.profiles self.packages = clone.packages + self.useforce_list = clone.useforce_list self.usemask_list = clone.usemask_list self.user_profile_dir = copy.deepcopy(clone.user_profile_dir) @@ -1609,7 +1611,6 @@ class config(object): self.usemask = copy.deepcopy(clone.usemask) self.pusemask_list = copy.deepcopy(clone.pusemask_list) self.useforce = copy.deepcopy(clone.useforce) - self.useforce_list = copy.deepcopy(clone.useforce_list) self.puseforce_list = copy.deepcopy(clone.puseforce_list) self.puse = copy.deepcopy(clone.puse) self.make_defaults_use = copy.deepcopy(clone.make_defaults_use) @@ -1633,7 +1634,6 @@ class config(object): self._use_expand_dict = copy.deepcopy(clone._use_expand_dict) self.backupenv = self.configdict["backupenv"] self.pusedict = copy.deepcopy(clone.pusedict) - self.categories = copy.deepcopy(clone.categories) self.pkeywordsdict = copy.deepcopy(clone.pkeywordsdict) self._pkeywords_list = copy.deepcopy(clone._pkeywords_list) self.pmaskdict = copy.deepcopy(clone.pmaskdict) @@ -1815,8 +1815,9 @@ class config(object): self.pkgprofileuse.append(cpdict) del rawprofileuse - self.useforce_list = [grabfile(os.path.join(x, "use.force"), - recursive=1) for x in self.profiles] + self.useforce_list = tuple( + tuple(grabfile(os.path.join(x, "use.force"), recursive=1)) + for x in self.profiles) self.useforce = set(stack_lists( self.useforce_list, incremental=True)) |