Perhaps it is a better idea to have our own implementation of _LibGraphNode in Linkag...
authorFabian Groffen <grobian@gentoo.org>
Sun, 2 Nov 2008 09:47:42 +0000 (09:47 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 2 Nov 2008 09:47:42 +0000 (09:47 -0000)
svn path=/main/branches/prefix/; revision=11797

pym/portage/dbapi/vartree.py

index a9ece12e21d6bd7e41e97b29baf302da3a124c82..9181e3013b84c60624fa7ae4c75afa17a56b335e 100644 (file)
@@ -687,6 +687,16 @@ class LinkageMapMachO(object):
                        """
                        return isinstance(self._key, tuple)
 
+       class _LibGraphNode(_ObjectKey):
+               __slots__ = ("alt_paths",)
+
+               def __init__(self, obj, root):
+                       LinkageMapMachO._ObjectKey.__init__(self, obj, root)
+                       self.alt_paths = set()
+
+               def __str__(self):
+                       return str(sorted(self.alt_paths))
+
        def rebuild(self, exclude_pkgs=None, include_file=None):
                root = self._root
                libs = {}
@@ -3014,7 +3024,10 @@ class dblink(object):
                def path_to_node(path):
                        node = path_node_map.get(path)
                        if node is None:
-                               node = LinkageMap._LibGraphNode(path, root)
+                               if ostype == "Darwin":
+                                       node = LinkageMapMachO._LibGraphNode(path, root)
+                               else:
+                                       node = LinkageMap._LibGraphNode(path, root)
                                alt_path_node = lib_graph.get(node)
                                if alt_path_node is not None:
                                        node = alt_path_node