depgraph: pull in new virtual slots with --update
authorZac Medico <zmedico@gentoo.org>
Fri, 9 Sep 2011 19:58:27 +0000 (12:58 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 9 Sep 2011 19:58:27 +0000 (12:58 -0700)
Previously, the virtual cost minimization code from bug #141118 would
prevent virtual dependencies from pulling in new slots. That behavior
was not desired for --update, so now it's fixed to pull in the latest
slot available. This allows virtual/jdk-1.7.0 to be pulled in by
dependencies when --update is enabled.

pym/_emerge/depgraph.py

index de7bd4abf5c4d058f16559edeaabc5b518356106..d6728c1064ceb268f239243060525ac4f0456122 100644 (file)
@@ -6567,8 +6567,14 @@ class _dep_check_composite_db(dbapi):
                                        continue
                                self._cpv_pkg_map[pkg.cpv] = pkg
                                ret.append(pkg.cpv)
-                       if ret:
+
+                       if len(ret) > 1:
                                self._cpv_sort_ascending(ret)
+                               if "--update" in self._depgraph._frozen_config.myopts:
+                                       # With --update, we want to force selection of
+                                       # the highest available version.
+                                       ret = [ret[-1]]
+
                self._match_cache[atom] = ret
                return ret[:]