Fix the depgraph package selection cache to update the "existing node"
authorZac Medico <zmedico@gentoo.org>
Sat, 5 Apr 2008 10:30:43 +0000 (10:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 5 Apr 2008 10:30:43 +0000 (10:30 -0000)
state of packages if they've been added to the graph since the last
call.

svn path=/main/trunk/; revision=9717

pym/_emerge/__init__.py

index a93997fc21d20c8b5e608795e1bfffdc05373272..bc8cbd20588ee9cab1af39d30170c00a3aea4ce0 100644 (file)
@@ -2484,6 +2484,14 @@ class depgraph(object):
                cache_key = (root, atom, onlydeps)
                ret = self._highest_pkg_cache.get(cache_key)
                if ret is not None:
+                       pkg, existing = ret
+                       if pkg and not existing:
+                               existing = self._slot_pkg_map[root].get(pkg.slot_atom)
+                               if existing and existing == pkg:
+                                       # Update the cache to reflect that the
+                                       # package has been added to the graph.
+                                       ret = pkg, pkg
+                                       self._highest_pkg_cache[cache_key] = ret
                        return ret
                ret = self._select_pkg_highest_available_imp(root, atom, onlydeps=onlydeps)
                self._highest_pkg_cache[cache_key] = ret