From: Fabian Groffen Date: Fri, 11 Apr 2008 10:59:35 +0000 (-0000) Subject: Implement sort of 'stub' for getlibpaths in Prefix. I'm still quite concerned that... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e46ea6adffa65560223084f47862c3bb0dde628b;p=portage.git Implement sort of 'stub' for getlibpaths in Prefix. I'm still quite concerned that this is used, and actually not convinced that it makes sense at all. svn path=/main/branches/prefix/; revision=9830 --- diff --git a/pym/portage/util.py b/pym/portage/util.py index 4a53a3611..b0a786789 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -1086,15 +1086,22 @@ def new_protect_filename(mydest, newmd5=None): def getlibpaths(): """ Return a list of paths that are used for library lookups """ - # PREFIX HIJACK: if this function is used (it seems to be just added - # nothing more, then let us know, because then we need to fix this... - raise "This is not prefix-proof, and certainly not x-platform proof!" - - # the following is based on the information from ld.so(8) - rval = os.environ.get("LD_LIBRARY_PATH", "").split(":") - rval.extend(grabfile("/etc/ld.so.conf")) - rval.append("/usr/lib") - rval.append("/lib") + # PREFIX HACK: LD_LIBRARY_PATH isn't portable, and considered + # harmfull, so better not use it. We don't need any host OS lib + # paths either, so do Prefix case. + if EPREFIX != '': + rval = [] + rval.append(EPREFIX + "/usr/lib") + rval.append(EPREFIX + "/lib") + # we don't know the CHOST here, so it's a bit hard to guess + # where GCC's and ld's libs are. Though, GCC's libs should be + # in lib and usr/lib, binutils' libs rarely used + else: + # the following is based on the information from ld.so(8) + rval = os.environ.get("LD_LIBRARY_PATH", "").split(":") + rval.extend(grabfile("/etc/ld.so.conf")) + rval.append("/usr/lib") + rval.append("/lib") rval = [normalize_path(x) for x in rval if x != ""]