When removing entries with duplicate paths inside binarytree.inject(), handle
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Dec 2008 01:20:27 +0000 (01:20 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Dec 2008 01:20:27 +0000 (01:20 -0000)
path collisions in $PKGDIR/All when CPV is not identical. (trunk r12282)

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

pym/portage/dbapi/bintree.py

index 1b66cc9b85e8a20ae30baa22daaa34278272047a..edba51a39f45e543bb6aba0da45c6ddbd27a9d6f 100644 (file)
@@ -861,11 +861,14 @@ class binarytree(object):
                                return
 
                        # If found, remove package(s) with duplicate path.
+                       path = d.get("PATH")
                        for i in xrange(len(pkgindex.packages) - 1, -1, -1):
                                d2 = pkgindex.packages[i]
-                               if d2["CPV"] != cpv:
-                                       continue
-                               if d2.get("PATH", "") == d.get("PATH", ""):
+                               if path is not None and path == d2.get("PATH"):
+                                       # Handle path collisions in $PKGDIR/All
+                                       # when CPV is not identical.
+                                       del pkgindex.packages[i]
+                               elif cpv == d2.get("CPV") and path == d2.get("PATH"):
                                        del pkgindex.packages[i]
                        pkgindex.packages.append(d)