Fix breakage in stale metadata logic inside binarytree._poplulate().
authorZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:50:25 +0000 (21:50 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 12 Dec 2008 21:50:25 +0000 (21:50 -0000)
(trunk r12211)

svn path=/main/branches/2.1.6/; revision=12242

pym/portage/dbapi/bintree.py

index 1e9f9aeebec45d078f297071bf1a96b7bb71b2e6..04f598a13cf4334c5785f02b746994157008ddc3 100644 (file)
@@ -598,13 +598,14 @@ class binarytree(object):
                                                        aux_cache[k] = d[k]
                                                self.dbapi._aux_cache[mycpv] = aux_cache
 
+                       for cpv in list(metadata):
+                               if cpv not in pkg_paths:
+                                       del metadata[cpv]
+
                        # Do not bother to write the Packages index if $PKGDIR/All/ exists
                        # since it will provide no benefit due to the need to read CATEGORY
                        # from xpak.
                        if update_pkgindex and os.access(self.pkgdir, os.W_OK):
-                               stale = [cpv for cpv in metadata if cpv not in self._pkg_paths]
-                               for cpv in stale:
-                                       del metadata[cpv]
                                del pkgindex.packages[:]
                                pkgindex.packages.extend(metadata.itervalues())
                                self._update_pkgindex_header(pkgindex.header)