From 760f648876f245a5a3254f1786c7fa38ffa6c2ac Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 23 Mar 2008 22:31:57 +0000 Subject: [PATCH] Genone's preserve-libs is a bit Linux/ELF tuned, make sure the keys of the reverse map contain basenames only, so we get a little bit more functioning on Darwin. svn path=/main/branches/prefix/; revision=9497 --- pym/portage/dbapi/vartree.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5dd530101..e67f56197 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -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: -- 2.26.2