actually remove libraries that aren't strictly needed from the preservation candidate...
authorMarius Mauch <genone@gentoo.org>
Sun, 4 May 2008 14:16:14 +0000 (14:16 -0000)
committerMarius Mauch <genone@gentoo.org>
Sun, 4 May 2008 14:16:14 +0000 (14:16 -0000)
svn path=/main/trunk/; revision=10182

pym/portage/dbapi/vartree.py

index 554f997bf4a506ba54aa1c783c8caf984e789113..a72d0edca5b2f891eb457bf1f7c01957d8d70b95 100644 (file)
@@ -1687,6 +1687,7 @@ class dblink(object):
                for lib in list(candidates):
                        if not has_external_consumers(lib, old_contents, candidates):
                                candidates.remove(lib)
+                               continue
                        # only preserve the lib if there is no other copy to use for each consumer
                        keep = False
                        for c in linkmap.findConsumers(lib):
@@ -1695,12 +1696,15 @@ class dblink(object):
                                for soname in providers:
                                        if lib in providers[soname]:
                                                for p in providers[soname]:
-                                                       if p not in candidates:
+                                                       if p not in candidates or os.path.exists(os.path.join(srcroot, p.lstrip(os.sep))):
                                                                localkeep = False
                                                                break
                                                break
                                if localkeep:
                                        keep = True
+                       if not keep:
+                               candidates.remove(lib)
+                               continue
                
                del mylibs, mycontents, old_contents, liblist