Make dep_check use depgraph._pkg_use_enabled to query USE settings of new-style virtu...
authorZac Medico <zmedico@gentoo.org>
Fri, 6 Aug 2010 22:38:21 +0000 (15:38 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 6 Aug 2010 22:54:05 +0000 (15:54 -0700)
pym/_emerge/depgraph.py
pym/portage/dep/dep_check.py

index 82388bb42c5a1bc88b205b4105a103551f6a2e2f..d765055ba097a677be79782c798dc3142de632e8 100644 (file)
@@ -2141,12 +2141,14 @@ class depgraph(object):
                pkgsettings = self._frozen_config.pkgsettings[root]
                if trees is None:
                        trees = self._dynamic_config._filtered_trees
+               mytrees = trees[root]
                atom_graph = digraph()
                if True:
                        # Temporarily disable autounmask so that || preferences
                        # account for masking and USE settings.
                        _autounmask_backup = self._dynamic_config._autounmask
                        self._dynamic_config._autounmask = False
+                       mytrees["pkg_use_enabled"] = self._pkg_use_enabled
                        try:
                                if parent is not None:
                                        trees[root]["parent"] = parent
@@ -2160,6 +2162,7 @@ class depgraph(object):
                                        myroot=root, trees=trees)
                        finally:
                                self._dynamic_config._autounmask = _autounmask_backup
+                               del mytrees["pkg_use_enabled"]
                                if parent is not None:
                                        trees[root].pop("parent")
                                        trees[root].pop("atom_graph")
index f4a44611837ccc1b4e3bdcb7f503c6e7285a37c9..8747bb148354d56f23eaa0ab1a6249b0d1a0c8da 100644 (file)
@@ -28,6 +28,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
        newsplit = []
        mytrees = trees[myroot]
        portdb = mytrees["porttree"].dbapi
+       pkg_use_enabled = mytrees.get("pkg_use_enabled")
        atom_graph = mytrees.get("atom_graph")
        parent = mytrees.get("parent")
        virt_parent = mytrees.get("virt_parent")
@@ -100,7 +101,8 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                                atom_graph.add(x, graph_parent)
                        continue
 
-               if repoman or not hasattr(portdb, 'match_pkgs'):
+               if repoman or not hasattr(portdb, 'match_pkgs') or \
+                       pkg_use_enabled is None:
                        if portdb.cp_list(x.cp):
                                newsplit.append(x)
                        else:
@@ -149,7 +151,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                        # should enforce this.
                        depstring = pkg.metadata['RDEPEND']
                        pkg_kwargs = kwargs.copy()
-                       pkg_kwargs["myuse"] = pkg.use.enabled
+                       pkg_kwargs["myuse"] = pkg_use_enabled(pkg)
                        if edebug:
                                writemsg_level(_("Virtual Parent:      %s\n") \
                                        % (pkg,), noiselevel=-1, level=logging.DEBUG)