pkg_use_enabled: return early for built pkgs
authorZac Medico <zmedico@gentoo.org>
Mon, 13 Jun 2011 21:50:04 +0000 (14:50 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 13 Jun 2011 21:50:04 +0000 (14:50 -0700)
Built/installed packages have frozen USE settings, so there's no sense
in considering them for autounmask USE config changes. They'll simply
be rejected by select_package, and an unbuilt ebuild will be selected
instead. This will fix bug 371423 by avoiding unnecessary use_reduce
calls on the deps of installed packages.

pym/_emerge/depgraph.py

index 9ce199b159df145c24d9d8275aba2fb171f585bc..da48f2affefa2a8ac7f5eb3e883a7e740e4af6b7 100644 (file)
@@ -3440,6 +3440,8 @@ class depgraph(object):
                Example: target_use = { "foo": True, "bar": False }
                The flags target_use must be in the pkg's IUSE.
                """
+               if pkg.built:
+                       return pkg.use.enabled
                needed_use_config_change = self._dynamic_config._needed_use_config_changes.get(pkg)
 
                if target_use is None:
@@ -3739,7 +3741,7 @@ class depgraph(object):
                                        if atom.use:
 
                                                matched_pkgs_ignore_use.append(pkg)
-                                               if allow_use_changes:
+                                               if allow_use_changes and not pkg.built:
                                                        target_use = {}
                                                        for flag in atom.use.enabled:
                                                                target_use[flag] = True