Use Package.use.force/mask attributes.
authorZac Medico <zmedico@gentoo.org>
Sun, 21 Nov 2010 03:17:49 +0000 (19:17 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 21 Nov 2010 03:17:49 +0000 (19:17 -0800)
pym/_emerge/depgraph.py
pym/_emerge/resolver/circular_dependency.py

index 8c9d3f0493c7692f12015cc63340efc50ca1e33c..5727dc296dcf11877560a2213e439f1df2b7dacd 100644 (file)
@@ -2285,10 +2285,8 @@ class depgraph(object):
                                need_enable = sorted(atom.use.enabled.difference(use).intersection(pkg.iuse.all))
                                need_disable = sorted(atom.use.disabled.intersection(use).intersection(pkg.iuse.all))
 
-                               pkgsettings = self._frozen_config.pkgsettings[pkg.root]
-                               pkgsettings.setcpv(pkg)
                                untouchable_flags = \
-                                       frozenset(chain(pkgsettings.usemask, pkgsettings.useforce))
+                                       frozenset(chain(pkg.use.mask, pkg.use.force))
                                if untouchable_flags.intersection(
                                        chain(need_enable, need_disable)):
                                        continue
@@ -2336,10 +2334,8 @@ class depgraph(object):
                                        involved_flags = set(chain(conditional.equal, conditional.not_equal, \
                                                conditional.enabled, conditional.disabled))
 
-                                       pkgsettings = self._frozen_config.pkgsettings[myparent.root]
-                                       pkgsettings.setcpv(myparent)
                                        untouchable_flags = \
-                                               frozenset(chain(pkgsettings.usemask, pkgsettings.useforce))
+                                               frozenset(chain(myparent.use.mask, myparent.use.force))
                                        if untouchable_flags.intersection(involved_flags):
                                                continue
 
@@ -3096,10 +3092,9 @@ class depgraph(object):
                                                ("--newuse" in self._frozen_config.myopts or \
                                                "--reinstall" in self._frozen_config.myopts) and \
                                                cpv in vardb.match(atom):
-                                               pkgsettings.setcpv(pkg)
                                                forced_flags = set()
-                                               forced_flags.update(pkgsettings.useforce)
-                                               forced_flags.update(pkgsettings.usemask)
+                                               forced_flags.update(pkg.use.force)
+                                               forced_flags.update(pkg.use.mask)
                                                old_use = vardb.aux_get(cpv, ["USE"])[0].split()
                                                old_iuse = set(filter_iuse_defaults(
                                                        vardb.aux_get(cpv, ["IUSE"])[0].split()))
@@ -4798,10 +4793,8 @@ class depgraph(object):
                                                affecting_use.update(extract_affecting_use(dep_str, atom))
                                        
                                        #Don't show flags as 'affecting' if the user can't change them,
-                                       pkgsettings = self._frozen_config.pkgsettings[node.root]
-                                       pkgsettings.setcpv(node)
-                                       affecting_use.difference_update(pkgsettings.usemask, \
-                                               pkgsettings.useforce)
+                                       affecting_use.difference_update(node.use.mask, \
+                                               node.use.force)
 
                                        pkg_name = node.cpv
                                        if affecting_use:
index 78c5bebc7b2e36ee86209d1e2b1ca0416faac4b2..9d3f5c68dd4b03d71c1c75c9de42823c12f7eb6a 100644 (file)
@@ -79,9 +79,7 @@ class circular_dependency_handler(object):
                return "\n".join(msg)
 
        def _get_use_mask_and_force(self, pkg):
-               pkgsettings = self.depgraph._frozen_config.pkgsettings[pkg.root]
-               pkgsettings.setcpv(pkg)
-               return frozenset(pkgsettings.usemask), frozenset(pkgsettings.useforce)
+               return pkg.use.mask, pkg.use.force
 
        def _get_autounmask_changes(self, pkg):
                needed_use_config_change = self.depgraph._dynamic_config._needed_use_config_changes.get(pkg)