Do not preserve the master link of a library to avoid packages being linked against...
authorMarius Mauch <genone@gentoo.org>
Tue, 17 Jun 2008 17:03:40 +0000 (17:03 -0000)
committerMarius Mauch <genone@gentoo.org>
Tue, 17 Jun 2008 17:03:40 +0000 (17:03 -0000)
svn path=/main/trunk/; revision=10693

pym/portage/dbapi/vartree.py

index b184630ac2166c61cdbf4b1d4f7bc4bf96bd11eb..2dbb747a041aa252c5fe0069ed6fbb47bd8ec7a0 100644 (file)
@@ -180,6 +180,17 @@ class LinkageMap(object):
                self._libs = libs
                self._obj_properties = obj_properties
 
+               return self._obj_properties[obj]
+
+       def isMasterLink(self, obj):
+               basename = os.path.basename(obj)
+               if obj not in self._obj_properties:
+                       obj = os.path.realpath(obj)
+                       if obj not in self._obj_properties:
+                               raise KeyError("%s not in object list" % obj)
+               soname = self._obj_properties[obj][3]
+               return (len(basename) < len(soname))
+               
        def listLibraryObjects(self):
                rValue = []
                if not self._libs:
@@ -2010,6 +2021,9 @@ class dblink(object):
                        if not has_external_consumers(lib, old_contents, candidates):
                                candidates.remove(lib)
                                continue
+                       if linkmap.isMasterLink(lib):
+                               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):