From 8b3080224f166ea0aceb30c82af12913a4008b2f Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 2 Nov 2008 09:47:42 +0000 Subject: [PATCH] Perhaps it is a better idea to have our own implementation of _LibGraphNode in LinkageMapMachO... svn path=/main/branches/prefix/; revision=11797 --- pym/portage/dbapi/vartree.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index a9ece12e2..9181e3013 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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 -- 2.26.2