BacktrackParameter: fix runtime_pkg_mask copy
authorZac Medico <zmedico@gentoo.org>
Wed, 27 Jun 2012 21:55:49 +0000 (14:55 -0700)
committerZac Medico <zmedico@gentoo.org>
Wed, 27 Jun 2012 21:55:49 +0000 (14:55 -0700)
This caused the backtracker to bail out too early sometimes.

pym/_emerge/resolver/backtracking.py

index 00a07bcb6191717d5d595b78478ad1d545dde83a..d8f49c679c28e2da64fadb25d2b0b8191fd3e8eb 100644 (file)
@@ -31,13 +31,17 @@ class BacktrackParameter(object):
                #to our sets and dicts. The existing content is immutable.
                result.needed_unstable_keywords = copy.copy(self.needed_unstable_keywords)
                result.needed_p_mask_changes = copy.copy(self.needed_p_mask_changes)
-               result.runtime_pkg_mask = copy.copy(self.runtime_pkg_mask)
                result.needed_use_config_changes = copy.copy(self.needed_use_config_changes)
                result.needed_license_changes = copy.copy(self.needed_license_changes)
                result.rebuild_list = copy.copy(self.rebuild_list)
                result.reinstall_list = copy.copy(self.reinstall_list)
                result.slot_abi_replace_installed = copy.copy(self.slot_abi_replace_installed)
 
+               # runtime_pkg_mask contains nested dicts that must also be copied
+               result.runtime_pkg_mask = {}
+               for k, v in self.runtime_pkg_mask.items():
+                       result.runtime_pkg_mask[k] = copy.copy(v)
+
                return result
 
        def __eq__(self, other):