try to follow the changed 'interface' of linkmap in our MachO implementation
authorFabian Groffen <grobian@gentoo.org>
Thu, 8 May 2008 20:01:27 +0000 (20:01 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 8 May 2008 20:01:27 +0000 (20:01 -0000)
svn path=/main/branches/prefix/; revision=10248

pym/portage/dbapi/vartree.py

index 6a9a448fe8ed0bde9c02751eb4acce4d4d680187..6a641b3486f0efa7be904efa81b22711fe1b92a8 100644 (file)
@@ -235,13 +235,16 @@ class LinkageMapMachO(object):
                self._libs = {}
                self._obj_properties = {}
 
-       def rebuild(self):
+       def rebuild(self, include_file=None):
                libs = {}
                obj_properties = {}
                lines = []
                for cpv in self._dbapi.cpv_all():
                        lines += grabfile(self._dbapi.getpath(cpv, filename="NEEDED.MACHO.2"))
 
+               if include_file:
+                       lines += grabfile(include_file)
+
                for l in lines:
                        if l.strip() == "":
                                continue
@@ -1763,7 +1766,10 @@ class dblink(object):
        def _preserve_libs(self, srcroot, destroot, mycontents, counter, inforoot):
                # read global reverse NEEDED map
                linkmap = self.vartree.dbapi.linkmap
-               linkmap.rebuild(include_file=os.path.join(inforoot, "NEEDED.ELF.2"))
+               if ostype == "Darwin":
+                       linkmap.rebuild(include_file=os.path.join(inforoot, "NEEDED.MACHO.2"))
+               else:
+                       linkmap.rebuild(include_file=os.path.join(inforoot, "NEEDED.ELF.2"))
                liblist = linkmap.listLibraryObjects()
 
                # get list of libraries from old package instance