-#!/bin/bash
+#!@PORTAGE_BASH@
- # Copyright 1999-2011 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
-PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
+PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"
+PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}"
# Prevent aliases from causing portage to act inappropriately.
# Make sure it's before everything so we don't mess aliases that follow.
-#!/bin/bash
+#!@PREFIX_PORTAGE_BASH@
- # Copyright 1999-2011 Gentoo Foundation
+ # Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Hardcoded bash lists are needed for backward compatibility with
""" Return a list of paths that are used for library lookups """
if env is None:
env = os.environ
+
+ # 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 = env.get("LD_LIBRARY_PATH", "").split(":")
- rval.extend(read_ld_so_conf(os.path.join(root, "etc", "ld.so.conf")))
- rval.append("/usr/lib")
- rval.append("/lib")
+ rval = env.get("LD_LIBRARY_PATH", "").split(":")
- rval.extend(grabfile(os.path.join(root, "etc", "ld.so.conf")))
++ rval.extend(read_ld_so_conf(os.path.join(root, "etc", "ld.so.conf")))
+ rval.append("/usr/lib")
+ rval.append("/lib")
return [normalize_path(x) for x in rval if x]