Genone's preserve-libs is a bit Linux/ELF tuned, make sure the keys of the reverse...
authorFabian Groffen <grobian@gentoo.org>
Sun, 23 Mar 2008 22:31:57 +0000 (22:31 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 23 Mar 2008 22:31:57 +0000 (22:31 -0000)
svn path=/main/branches/prefix/; revision=9497

pym/portage/dbapi/vartree.py

index 5dd53010132024794c5e6881440b070be1de4efc..e67f56197d38daeb69b98cd02025a7391f7c0216 100644 (file)
@@ -157,6 +157,16 @@ class LibraryPackageMap(object):
                                        continue
                                libs = mysplit[1].split(",")
                                for lib in libs:
+                                       # The contract says we only have basenames in the
+                                       # keys of the reverse map (as that is the only thing
+                                       # available on Linux/ELF) and the code calling this
+                                       # assumes/uses this.  However, Darwin's MACH-O
+                                       # objects have full paths to the objects, and
+                                       # Sun/Solaris' ELF objects can have (and do have)
+                                       # absolute path arguments, so extract the basename
+                                       # for the key here to make sure we respect the
+                                       # contract.
+                                       lib = os.path.basename(lib)
                                        if not obj_dict.has_key(lib):
                                                obj_dict[lib] = [mysplit[0]]
                                        else: